From 3419e1204148e54500f86f4c1a7fae63b2b974a2 Mon Sep 17 00:00:00 2001 From: mquinson Date: Tue, 23 Oct 2007 13:51:24 +0000 Subject: [PATCH] Reduce the unimplemented part git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4863 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/xbt/xbt_os_thread.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/xbt/xbt_os_thread.c b/src/xbt/xbt_os_thread.c index 52b76731a6..8114e8401f 100644 --- a/src/xbt/xbt_os_thread.c +++ b/src/xbt/xbt_os_thread.c @@ -316,10 +316,6 @@ xbt_os_sem_acquire(xbt_os_sem_t sem) void xbt_os_sem_timedacquire(xbt_os_sem_t sem,double timeout) { - /* mac os x have not the sem_timedwait() function */ - #ifndef HAVE_SEM_TIMEDWAIT - THROW_UNIMPLEMENTED; - #else int errcode; struct timespec ts_end; double end = timeout + xbt_os_time(); @@ -333,6 +329,10 @@ void xbt_os_sem_timedacquire(xbt_os_sem_t sem,double timeout) } else { + /* mac os x have not the sem_timedwait() function */ +#ifndef HAVE_SEM_TIMEDWAIT + THROW_UNIMPLEMENTED; +#else ts_end.tv_sec = (time_t) floor(end); ts_end.tv_nsec = (long) ( ( end - ts_end.tv_sec) * 1000000000); DEBUG2("sem_timedwait(%p,%p)",&(sem->s),&ts_end); @@ -348,8 +348,8 @@ void xbt_os_sem_timedacquire(xbt_os_sem_t sem,double timeout) default: THROW3(system_error,errcode,"sem_timedwait(%p,%f) failed: %s",sem,timeout, strerror(errcode)); } +#endif } - #endif } void -- 2.20.1