diff options
author | Jakob Bornecrantz <jakob@tungstengraphics.com> | 2008-05-23 16:26:14 +0200 |
---|---|---|
committer | Jakob Bornecrantz <jakob@tungstengraphics.com> | 2008-05-23 16:26:14 +0200 |
commit | a3dbd412df99c7d19b1f81b3b9ec7d5c8a09d069 (patch) | |
tree | baa0e115e726948268a60d5865897ab4e177ff79 /src/mesa | |
parent | e8d5be9c76b08ba423e3c635aae5178f2358169a (diff) | |
parent | a22462f6ef769129ee56223f1edc2cb851505da8 (diff) |
Merge branch 'gallium-i915-current' into gallium-0.1
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/glapi/glthread.h | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/src/mesa/glapi/glthread.h b/src/mesa/glapi/glthread.h index afb04f7bf2..b8e9d5f59b 100644 --- a/src/mesa/glapi/glthread.h +++ b/src/mesa/glapi/glthread.h @@ -116,9 +116,49 @@ typedef pthread_mutex_t _glthread_Mutex; #define _glthread_UNLOCK_MUTEX(name) \ (void) pthread_mutex_unlock(&(name)) -#endif /* PTHREADS */ +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)) + + +#else /* PTHREADS */ + +typedef unsigned int _glthread_Cond; +#define _glthread_DECLARE_STATIC_COND(name) \ +// #warning Condition variables not implemented. + +#define _glthread_INIT_COND(cond) \ + abort(); + +#define _glthread_DESTROY_COND(name) \ + abort(); + +#define _glthread_COND_WAIT(cond, mutex) \ + abort(); + +#define _glthread_COND_SIGNAL(cond) \ + abort(); + +#define _glthread_COND_BROADCAST(cond) \ + abort(); + +#endif /* @@ -259,11 +299,11 @@ typedef benaphore _glthread_Mutex; * THREADS not defined */ -typedef unsigned _glthread_TSD; +typedef GLuint _glthread_TSD; -typedef unsigned _glthread_Thread; +typedef GLuint _glthread_Thread; -typedef unsigned _glthread_Mutex; +typedef GLuint _glthread_Mutex; #define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0 |