X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/58b8f451a5354b82983ed68155c16496a9bca822..9a444de20a7545d1c3d10bd242f317febded25c4:/src/xbt/xbt_os_thread.c diff --git a/src/xbt/xbt_os_thread.c b/src/xbt/xbt_os_thread.c index 7d58f3e40f..b2be4c7fe6 100644 --- a/src/xbt/xbt_os_thread.c +++ b/src/xbt/xbt_os_thread.c @@ -23,7 +23,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_sync_os, xbt, /* ********************************* PTHREAD IMPLEMENTATION ************************************ */ #ifdef HAVE_PTHREAD_H -#include #include #ifdef HAVE_MUTEX_TIMEDLOCK @@ -496,7 +495,7 @@ xbt_os_sem_t xbt_os_sem_init(unsigned int value) if ((res->ps == (sem_t *) SEM_FAILED) && (errno == ENAMETOOLONG)) { /* Old darwins only allow 13 chars. Did you create *that* amount of semaphores? */ res->name[13] = '\0'; - res->ps = sem_open(res->name, O_CREAT, 0644, 1); + res->ps = sem_open(res->name, O_CREAT, 0644, value); } if ((res->ps == (sem_t *) SEM_FAILED)) THROWF(system_error, errno, "sem_open() failed: %s", strerror(errno)); @@ -1180,7 +1179,7 @@ void *xbt_os_thread_get_extra_data(void) xbt_os_rmutex_t xbt_os_rmutex_init(void) { - xbt_os_rmutex_t rmutex = xbt_new0(struct xbt_os_rmutex_, 0); + xbt_os_rmutex_t rmutex = xbt_new0(struct xbt_os_rmutex_, 1); rmutex->mutex = xbt_os_mutex_init(); rmutex->owner = NULL; rmutex->count = 0;