diff --git a/src/lib/thread.hpp b/src/lib/thread.hpp index 99f2a706d..57b749391 100644 --- a/src/lib/thread.hpp +++ b/src/lib/thread.hpp @@ -391,6 +391,8 @@ namespace lib { void invokeThreadFunction (ARGS&& ...args) { + while (not Policy::isLive()) // wait for thread-ID to become visible + std::this_thread::yield();// (typically happens when debugging) Policy::handle_begin_thread(); Policy::markThreadStart(); Policy::perform_thread_function (forward (args)...);