A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix a race condition
[simgrid.git]
/
src
/
kernel
/
context
/
ContextSwapped.cpp
diff --git
a/src/kernel/context/ContextSwapped.cpp
b/src/kernel/context/ContextSwapped.cpp
index
cb2f314
..
87da1fc
100644
(file)
--- a/
src/kernel/context/ContextSwapped.cpp
+++ b/
src/kernel/context/ContextSwapped.cpp
@@
-134,9
+134,16
@@
SwappedContext::~SwappedContext()
xbt_free(stack_);
}
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::stop()
{
Context::stop();
void SwappedContext::stop()
{
Context::stop();
+ /* We must cut the actor execution using an exception to properly free the C++ RAII variables */
throw StopRequest();
}
throw StopRequest();
}