- main_thread->exception = xbt_new(ex_ctx_t, 1);
- XBT_CTX_INITIALIZE(main_thread->exception);
+ main_thread->running_ctx = xbt_new(xbt_running_ctx_t, 1);
+ XBT_RUNNING_CTX_INITIALIZE(main_thread->running_ctx);
+
+ if ((errcode = pthread_setspecific(xbt_self_thread_key, main_thread)))
+ THROWF(system_error, errcode,
+ "pthread_setspecific failed for xbt_self_thread_key");