summaryrefslogtreecommitdiff
path: root/src/gallium/include
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2008-04-11 12:11:14 +0900
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2008-04-11 12:18:06 +0900
commit03a3373bdf929b6b7c43600c9eebb0c4ee3ff38f (patch)
tree7a3abb07de8036ac541b62370e179faaa24be316 /src/gallium/include
parent544c236db10a0d4889014cd82e81b1de3451b5db (diff)
gallium: Thread condition variables.
Diffstat (limited to 'src/gallium/include')
-rw-r--r--src/gallium/include/pipe/p_thread.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/gallium/include/pipe/p_thread.h b/src/gallium/include/pipe/p_thread.h
index 4325abc951..af9150aafb 100644
--- a/src/gallium/include/pipe/p_thread.h
+++ b/src/gallium/include/pipe/p_thread.h
@@ -114,6 +114,26 @@ typedef pthread_mutex_t _glthread_Mutex;
#define _glthread_UNLOCK_MUTEX(name) \
(void) pthread_mutex_unlock(&(name))
+typedef pthread_cond_t _glthread_Cond;
+
+#define _glthread_DECLARE_STATIC_COND(name) \
+ static _glthread_Cond name = PTHREAD_COND_INITIALIZER
+
+#define _glthread_INIT_COND(cond) \
+ pthread_cond_init(&(cond), NULL)
+
+#define _glthread_DESTROY_COND(name) \
+ pthread_cond_destroy(&(name))
+
+#define _glthread_COND_WAIT(cond, mutex) \
+ pthread_cond_wait(&(cond), &(mutex))
+
+#define _glthread_COND_SIGNAL(cond) \
+ pthread_cond_signal(&(cond))
+
+#define _glthread_COND_BROADCAST(cond) \
+ pthread_cond_broadcast(&(cond))
+
#endif /* PTHREADS */
@@ -273,6 +293,20 @@ typedef unsigned _glthread_Mutex;
#define _glthread_UNLOCK_MUTEX(name) (void) name
+typedef unsigned _glthread_Cond;
+
+#define _glthread_DECLARE_STATIC_COND(name) static _glthread_Cond name = 0
+
+#define _glthread_INIT_COND(name) (void) name
+
+#define _glthread_DESTROY_COND(name) (void) name
+
+#define _glthread_COND_WAIT(name, mutex) (void) name
+
+#define _glthread_COND_SIGNAL(name) (void) name
+
+#define _glthread_COND_BROADCAST(name) (void) name
+
#endif /* THREADS */