Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix sem_init testing.
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 30 Nov 2010 10:26:30 +0000 (10:26 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 30 Nov 2010 10:26:30 +0000 (10:26 +0000)
It was always disabled because the test program had missing arguments to sem_init().
Also the macros HAVE_SEM_INIT and HAVE_SEM_WAIT where mixed up.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8742 48e7efb5-ca39-0410-a469-dd3cf9ba447f

buildtools/Cmake/test_prog/prog_sem_init.c
src/xbt/xbt_os_thread.c

index 0fe001f..a745bdd 100644 (file)
@@ -9,5 +9,5 @@
 void main(void)
 {
   sem_t s;
 void main(void)
 {
   sem_t s;
-  sem_init(&s);
+  sem_init(&s, 0, 0);
 }
 }
index 4fcb70c..10f8266 100644 (file)
@@ -95,7 +95,7 @@ void xbt_os_thread_mod_preinit(void)
 
   thread_mod_inited = 1;
 
 
   thread_mod_inited = 1;
 
-#ifndef HAVE_SEM_WAIT
+#ifndef HAVE_SEM_INIT
   next_sem_ID_lock = xbt_os_mutex_init();
 #endif
 
   next_sem_ID_lock = xbt_os_mutex_init();
 #endif
 
@@ -113,7 +113,7 @@ void xbt_os_thread_mod_postexit(void)
   free(main_thread);
   main_thread = NULL;
   thread_mod_inited = 0;
   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_os_mutex_destroy(next_sem_ID_lock);
 #endif