- // Signal to the maestro that it has finished:
- context->yield();
-
-#ifndef WIN32
- stack.ss_flags = SS_DISABLE;
- sigaltstack(&stack, nullptr);
-#endif
- return nullptr;
-}
-
-void *ThreadContext::maestro_wrapper(void *param)
-{
- ThreadContext* context = static_cast<ThreadContext*>(param);
-
-#ifndef WIN32
- /* Install alternate signal stack, for SIGSEGV handler. */
- stack_t stack;
- stack.ss_sp = sigsegv_stack;
- stack.ss_size = sizeof sigsegv_stack;
- stack.ss_flags = 0;
- sigaltstack(&stack, nullptr);
-#endif
- /* Tell the caller we are starting */
- xbt_os_sem_release(context->end_);
-
- // Wait for the caller to give control back to us:
- context->start();
- (*context)();
-
- // Tell main that we have finished: