This reverts commit
92061e0bc62b9a2ef3bdc041e5e9fe716ada1120.
It's failing on appveyor (mingw64) with:
C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin\g++.exe -g3 -O3 -funroll-loops -fno-strict-aliasing -finline-functions -fdebug-prefix-map=C:/projects/simgrid=. -static-libgcc -static-libstdc++ -Wl,--add-stdcall-alias -m64 -shared -o lib\libsimgrid-java.dll -Wl,--out-implib,lib\libsimgrid-java.dll.a -Wl,--major-image-version,3,--minor-image-version,22 -Wl,--whole-archive CMakeFiles\simgrid-java.dir/objects.a -Wl,--no-whole-archive @CMakeFiles\simgrid-java.dir\linklibs.rsp
CMakeFiles\simgrid-java.dir/objects.a(jmsg.cpp.obj):././src/bindings/java/jmsg.cpp:342: undefined reference to `__imp__ZTHN7simgrid6kernel7context7Context8current_E'
CMakeFiles\simgrid-java.dir/objects.a(jmsg.cpp.obj):././src/bindings/java/jmsg.cpp:342: undefined reference to `__imp__ZTHN7simgrid6kernel7context7Context8current_E'
CMakeFiles\simgrid-java.dir/objects.a(jmsg.cpp.obj):././src/bindings/java/jmsg.cpp:342: undefined reference to `__imp__ZTHN7simgrid6kernel7context7Context8current_E'
CMakeFiles\simgrid-java.dir/objects.a(JavaContext.cpp.obj):././src/bindings/java/JavaContext.cpp:81: undefined reference to `__imp__ZTHN7simgrid6kernel7context7Context8current_E'
collect2.exe: error: ld returned 1 exit status
ContextFactory::~ContextFactory() = default;
-thread_local Context* Context::current_ = nullptr;
+static thread_local Context* smx_current_context = nullptr;
+Context* Context::self()
+{
+ return smx_current_context;
+}
+void Context::set_current(Context* self)
+{
+ smx_current_context = self;
+}
void Context::declare_context(std::size_t size)
{
class XBT_PUBLIC Context {
friend ContextFactory;
- static thread_local Context* current_;
-
std::function<void()> code_;
actor::ActorImpl* actor_ = nullptr;
void declare_context(std::size_t size);
// Retrieving the self() context
/** @brief Retrives the current context of this thread */
- static Context* self() { return current_; }
+ static Context* self();
/** @brief Sets the current context of this thread */
- static void set_current(Context* self) { current_ = self; }
+ static void set_current(Context* self);
};
class XBT_PUBLIC AttachContext : public Context {