Commit 59aa1fa3 authored by neverlord's avatar neverlord

fixed usage of detached hint in thread_pool_scheduler

parent 54738d06
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
namespace { namespace {
//std::mutex m_instance_mtx;
std::atomic<cppa::scheduler*> m_instance; std::atomic<cppa::scheduler*> m_instance;
/*
struct static_cleanup_helper struct static_cleanup_helper
{ {
~static_cleanup_helper() ~static_cleanup_helper()
...@@ -32,6 +32,7 @@ struct static_cleanup_helper ...@@ -32,6 +32,7 @@ struct static_cleanup_helper
} }
} }
s_cleanup_helper; s_cleanup_helper;
*/
} // namespace <anonymous> } // namespace <anonymous>
...@@ -71,7 +72,7 @@ void set_scheduler(scheduler* sched) ...@@ -71,7 +72,7 @@ void set_scheduler(scheduler* sched)
scheduler* s = nullptr; scheduler* s = nullptr;
if (m_instance.compare_exchange_weak(s, sched) == false) if (m_instance.compare_exchange_weak(s, sched) == false)
{ {
throw std::runtime_error("cannot set scheduler"); throw std::runtime_error("scheduler already set");
} }
} }
......
...@@ -178,7 +178,7 @@ void thread_pool_scheduler::schedule(scheduled_actor* what) ...@@ -178,7 +178,7 @@ void thread_pool_scheduler::schedule(scheduled_actor* what)
actor_ptr thread_pool_scheduler::spawn(actor_behavior* behavior, actor_ptr thread_pool_scheduler::spawn(actor_behavior* behavior,
scheduling_hint hint) scheduling_hint hint)
{ {
if (hint == scheduled) if (hint == detached)
{ {
return mock_scheduler::spawn(behavior); return mock_scheduler::spawn(behavior);
} }
......
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