Commit 66e53f85 authored by neverlord's avatar neverlord

reformatting

parent b32ac7c9
...@@ -51,8 +51,19 @@ class yielding_actor : public abstract_scheduled_actor ...@@ -51,8 +51,19 @@ class yielding_actor : public abstract_scheduled_actor
typedef abstract_scheduled_actor super; typedef abstract_scheduled_actor super;
util::fiber m_fiber; public:
std::function<void()> m_behavior;
yielding_actor(std::function<void()> fun);
void dequeue(behavior& bhvr); //override
void dequeue(partial_function& fun); //override
void resume(util::fiber* from, scheduler::callback* callback); //override
private:
typedef std::unique_ptr<recursive_queue_node> queue_node_ptr;
static void run(void* _this); static void run(void* _this);
...@@ -105,20 +116,8 @@ class yielding_actor : public abstract_scheduled_actor ...@@ -105,20 +116,8 @@ class yielding_actor : public abstract_scheduled_actor
}; };
public: util::fiber m_fiber;
std::function<void()> m_behavior;
yielding_actor(std::function<void()> fun);
void dequeue(behavior& bhvr); //override
void dequeue(partial_function& fun); //override
void resume(util::fiber* from, scheduler::callback* callback); //override
private:
typedef std::unique_ptr<recursive_queue_node> queue_node_ptr;
nestable_invoke_policy<filter_policy> m_invoke; nestable_invoke_policy<filter_policy> m_invoke;
}; };
......
...@@ -110,10 +110,10 @@ void yielding_actor::dequeue(behavior& bhvr) ...@@ -110,10 +110,10 @@ void yielding_actor::dequeue(behavior& bhvr)
auto& fun = bhvr.get_partial_function(); auto& fun = bhvr.get_partial_function();
if (bhvr.timeout().valid() == false) if (bhvr.timeout().valid() == false)
{ {
dequeue(fun); // suppress virtual function call
return; yielding_actor::dequeue(fun);
} }
if (m_invoke.invoke_from_cache(fun) == false) else if (m_invoke.invoke_from_cache(fun) == false)
{ {
request_timeout(bhvr.timeout()); request_timeout(bhvr.timeout());
bool timeout_occured = false; bool timeout_occured = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment