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