thread_mod_inited = 1;
-#ifndef HAVE_SEM_WAIT
+#ifndef HAVE_SEM_INIT
next_sem_ID_lock = xbt_os_mutex_init();
#endif
free(main_thread);
main_thread = NULL;
thread_mod_inited = 0;
-#ifndef HAVE_SEM_WAIT
+#ifndef HAVE_SEM_INIT
xbt_os_mutex_destroy(next_sem_ID_lock);
#endif
__xbt_ex_terminate = &__xbt_ex_terminate_default;
}
+int xbt_os_thread_atfork(void (*prepare)(void),
+ void (*parent)(void), void (*child)(void))
+{
+ return pthread_atfork(prepare, parent, child);
+}
+
static void *wrapper_start_routine(void *s)
{
xbt_os_thread_t t = s;
const char *xbt_os_thread_self_name(void)
{
- xbt_os_thread_t self = xbt_os_thread_self();
- return self ? self->name : "main";
+ xbt_os_thread_t me = xbt_os_thread_self();
+ return me ? me->name : "main";
}
void xbt_os_thread_join(xbt_os_thread_t thread, void **thread_return)
"TlsFree() failed to cleanup the thread submodule");
}
+int xbt_os_thread_atfork(void (*prepare)(void),
+ void (*parent)(void), void (*child)(void))
+{
+ return 0;
+}
+
static DWORD WINAPI wrapper_start_routine(void *s)
{
xbt_os_thread_t t = (xbt_os_thread_t) s;