+2008-09-13 Bruno Haible <bruno@clisp.org>
+
+ * 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 <bonzini@gnu.org>
* modules/poll-tests: Do not check for io.h.
#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
+
+/* ========================================================================= */
/* -------------------------- gl_cond_t datatype -------------------------- */
-#define ETIMEDOUT ETIME
-
typedef pthread_cond_t gl_cond_t;
# define gl_cond_define(STORAGECLASS, NAME) \
STORAGECLASS cond_t NAME;
# 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
}