# HG changeset patch # User Bruno Haible # Date 1221299759 -7200 # Node ID 3949004c48c87ef4f8f38bb6beda01ad3f61dc21 # Parent ddb4b92f4d2ad3a219a55aa4f7ff298e7bd346c5 Don't redefine ETIMEDOUT on Solaris. diff -r ddb4b92f4d2a -r 3949004c48c8 ChangeLog --- a/ChangeLog Fri Sep 12 20:20:38 2008 +0200 +++ b/ChangeLog Sat Sep 13 11:55:59 2008 +0200 @@ -1,3 +1,12 @@ +2008-09-13 Bruno Haible + + * lib/glthread/cond.h [USE_SOLARIS_THREADS] + (ETIMEDOUT): Remove macro. + (glthread_cond_timedwait_multithreaded): New declaration. + (glthread_cond_timedwait): Use it. + * lib/glthread/cond.c [USE_SOLARIS_THREADS] + (glthread_cond_timedwait_multithreaded): New function. + 2008-09-12 Paolo Bonzini * modules/poll-tests: Do not check for io.h. diff -r ddb4b92f4d2a -r 3949004c48c8 lib/glthread/cond.c --- a/lib/glthread/cond.c Fri Sep 12 20:20:38 2008 +0200 +++ b/lib/glthread/cond.c Sat Sep 13 11:55:59 2008 +0200 @@ -50,3 +50,24 @@ #endif /* ========================================================================= */ + +#if USE_SOLARIS_THREADS + +/* -------------------------- gl_cond_t datatype -------------------------- */ + +int +glthread_cond_timedwait_multithreaded (gl_cond_t *cond, + gl_lock_t *lock, + struct timespec *abstime) +{ + int ret; + + ret = cond_timedwait (cond, lock, abstime); + if (ret == ETIME) + return ETIMEDOUT; + return ret; +} + +#endif + +/* ========================================================================= */ diff -r ddb4b92f4d2a -r 3949004c48c8 lib/glthread/cond.h --- a/lib/glthread/cond.h Fri Sep 12 20:20:38 2008 +0200 +++ b/lib/glthread/cond.h Sat Sep 13 11:55:59 2008 +0200 @@ -239,8 +239,6 @@ /* -------------------------- gl_cond_t datatype -------------------------- */ -#define ETIMEDOUT ETIME - typedef pthread_cond_t gl_cond_t; # define gl_cond_define(STORAGECLASS, NAME) \ STORAGECLASS cond_t NAME; @@ -253,13 +251,14 @@ # define glthread_cond_wait(COND, LOCK) \ (pthread_in_use () ? cond_wait (COND, LOCK) : 0) # define glthread_cond_timedwait(COND, LOCK, ABSTIME) \ - (pthread_in_use () ? cond_timedwait (COND, LOCK, ABSTIME) : 0) + (pthread_in_use () ? glthread_cond_timedwait_multithreaded (COND, LOCK, ABSTIME) : 0) # define glthread_cond_signal(COND) \ (pthread_in_use () ? cond_signal (COND) : 0) # define glthread_cond_broadcast(COND) \ (pthread_in_use () ? cond_broadcast (COND) : 0) # define glthread_cond_destroy(COND) \ (pthread_in_use () ? cond_destroy (COND) : 0) +extern int glthread_cond_timedwait_multithreaded (gl_cond_t *cond, gl_lock_t *lock, struct timespec *abstime); # ifdef __cplusplus }