summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
836d550)
When saving the context of maestro, we must ensure that we are
actually thread 0. Otherwise, we may end up saving the context of a
minion (a working thread).
+void SwappedContext::set_maestro(SwappedContext* ctx)
+{
+ if (factory_->threads_working_ == 0) // Don't save the soul of minions, only the one of maestro
+ factory_->workers_context_[0] = ctx;
+}
+
void SwappedContext::stop()
{
Context::stop();
void SwappedContext::stop()
{
Context::stop();
+ /* We must cut the actor execution using an exception to properly free the C++ RAII variables */
virtual void swap_into(SwappedContext* to) = 0; // Defined in Raw, Boost and UContext subclasses
virtual void swap_into(SwappedContext* to) = 0; // Defined in Raw, Boost and UContext subclasses
- void set_maestro(SwappedContext* ctx) { factory_->workers_context_[0] = ctx; }
+ void set_maestro(SwappedContext* ctx);
// FIXME: Killme
static thread_local uintptr_t worker_id_;
// FIXME: Killme
static thread_local uintptr_t worker_id_;