From 88e507ca6ecc4ca606c87dcbdb22dd9baea37b4c Mon Sep 17 00:00:00 2001 From: mquinson Date: Tue, 30 Nov 2010 10:26:30 +0000 Subject: [PATCH 1/1] Fix sem_init testing. 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 | 2 +- src/xbt/xbt_os_thread.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buildtools/Cmake/test_prog/prog_sem_init.c b/buildtools/Cmake/test_prog/prog_sem_init.c index 0fe001f76a..a745bddd83 100644 --- a/buildtools/Cmake/test_prog/prog_sem_init.c +++ b/buildtools/Cmake/test_prog/prog_sem_init.c @@ -9,5 +9,5 @@ void main(void) { sem_t s; - sem_init(&s); + sem_init(&s, 0, 0); } diff --git a/src/xbt/xbt_os_thread.c b/src/xbt/xbt_os_thread.c index 4fcb70cdd9..10f8266ee2 100644 --- a/src/xbt/xbt_os_thread.c +++ b/src/xbt/xbt_os_thread.c @@ -95,7 +95,7 @@ void xbt_os_thread_mod_preinit(void) thread_mod_inited = 1; -#ifndef HAVE_SEM_WAIT +#ifndef HAVE_SEM_INIT 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; -#ifndef HAVE_SEM_WAIT +#ifndef HAVE_SEM_INIT xbt_os_mutex_destroy(next_sem_ID_lock); #endif -- 2.20.1