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
Kill the now useless ParallelRawContext and ParallelBoostContext
[simgrid.git]
/
src
/
kernel
/
context
/
Context.cpp
diff --git
a/src/kernel/context/Context.cpp
b/src/kernel/context/Context.cpp
index
8a72534
..
63321eb
100644
(file)
--- a/
src/kernel/context/Context.cpp
+++ b/
src/kernel/context/Context.cpp
@@
-34,7
+34,7
@@
ContextFactoryInitializer factory_initializer = nullptr;
ContextFactory::~ContextFactory() = default;
ContextFactory::~ContextFactory() = default;
-static thread_local smx_context_t smx_current_context;
+static thread_local smx_context_t smx_current_context
= nullptr
;
Context* Context::self()
{
return smx_current_context;
Context* Context::self()
{
return smx_current_context;
@@
-77,7
+77,11
@@
Context::Context(std::function<void()> code, void_pfn_smxprocess_t cleanup_func,
set_current(this);
}
set_current(this);
}
-Context::~Context() = default;
+Context::~Context()
+{
+ if (self() == this)
+ set_current(nullptr);
+}
void Context::stop()
{
void Context::stop()
{
@@
-99,12
+103,3
@@
void SIMIX_context_runall()
{
simix_global->context_factory->run_all();
}
{
simix_global->context_factory->run_all();
}
-
-/** @brief returns the current running context */
-smx_context_t SIMIX_context_self()
-{
- if (simix_global && simix_global->context_factory)
- return simgrid::kernel::context::Context::self();
- else
- return nullptr;
-}