A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Mac OS X doesn't provide the sem_timedwait() function.
[simgrid.git]
/
src
/
xbt
/
xbt_os_thread.c
diff --git
a/src/xbt/xbt_os_thread.c
b/src/xbt/xbt_os_thread.c
index
023848e
..
8465beb
100644
(file)
--- a/
src/xbt/xbt_os_thread.c
+++ b/
src/xbt/xbt_os_thread.c
@@
-317,6
+317,10
@@
xbt_os_sem_acquire(xbt_os_sem_t sem)
void xbt_os_sem_timedacquire(xbt_os_sem_t sem,double timeout)
{
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();
int errcode;
struct timespec ts_end;
double end = timeout + xbt_os_time();
@@
-346,6
+350,7
@@
void xbt_os_sem_timedacquire(xbt_os_sem_t sem,double timeout)
THROW3(system_error,errcode,"sem_timedwait(%p,%f) failed: %s",sem,timeout, strerror(errcode));
}
}
THROW3(system_error,errcode,"sem_timedwait(%p,%f) failed: %s",sem,timeout, strerror(errcode));
}
}
+ #endif
}
void
}
void