X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c641d112f8a557b61ff14c261931077773f21fbd..080e391e51390f2739098295d391680e05a6ca93:/src/kernel/context/ContextSwapped.cpp diff --git a/src/kernel/context/ContextSwapped.cpp b/src/kernel/context/ContextSwapped.cpp index cb2f31487d..b550205e99 100644 --- a/src/kernel/context/ContextSwapped.cpp +++ b/src/kernel/context/ContextSwapped.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -134,9 +134,21 @@ SwappedContext::~SwappedContext() xbt_free(stack_); } +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::get_stack() +{ + return stack_; +} + void SwappedContext::stop() { Context::stop(); + /* We must cut the actor execution using an exception to properly free the C++ RAII variables */ throw StopRequest(); }