summaryrefslogtreecommitdiff
path: root/src/mesa/glapi
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2002-12-12 13:03:15 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2002-12-12 13:03:15 +0000
commite15fd85727636627e0cc7d4fd2d5367e178e42cc (patch)
treebf71880e9da3502750d509739ebb7afe06d43f40 /src/mesa/glapi
parent76d2a77291eb323c138751c0c605d120efe6cb38 (diff)
Add mechanism to destroy mutexes. Important on OS's where mutex initialization
allocates memory (like FreeBSD).
Diffstat (limited to 'src/mesa/glapi')
-rw-r--r--src/mesa/glapi/glthread.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/glapi/glthread.h b/src/mesa/glapi/glthread.h
index 1b2a648da8..5281a3e703 100644
--- a/src/mesa/glapi/glthread.h
+++ b/src/mesa/glapi/glthread.h
@@ -1,4 +1,4 @@
-/* $Id: glthread.h,v 1.11 2002/03/07 21:50:41 brianp Exp $ */
+/* $Id: glthread.h,v 1.12 2002/12/12 13:03:15 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -101,6 +101,9 @@ typedef pthread_mutex_t _glthread_Mutex;
#define _glthread_INIT_MUTEX(name) \
pthread_mutex_init(&(name), NULL)
+#define _glthread_DESTROY_MUTEX(name) \
+ pthread_mutex_destroy(&(name))
+
#define _glthread_LOCK_MUTEX(name) \
(void) pthread_mutex_lock(&(name))
@@ -134,6 +137,7 @@ typedef mutex_t _glthread_Mutex;
/* XXX need to really implement mutex-related macros */
#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0
#define _glthread_INIT_MUTEX(name) (void) name
+#define _glthread_DESTROY_MUTEX(name) (void) name
#define _glthread_LOCK_MUTEX(name) (void) name
#define _glthread_UNLOCK_MUTEX(name) (void) name
@@ -162,6 +166,7 @@ typedef CRITICAL_SECTION _glthread_Mutex;
/* XXX need to really implement mutex-related macros */
#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0
#define _glthread_INIT_MUTEX(name) (void) name
+#define _glthread_DESTROY_MUTEX(name) (void) name
#define _glthread_LOCK_MUTEX(name) (void) name
#define _glthread_UNLOCK_MUTEX(name) (void) name
@@ -197,6 +202,9 @@ typedef xmutex_rec _glthread_Mutex;
#define _glthread_INIT_MUTEX(name) \
xmutex_init(&(name))
+#define _glthread_DESTROY_MUTEX(name) \
+ xmutex_clear(&(name))
+
#define _glthread_LOCK_MUTEX(name) \
(void) xmutex_lock(&(name))
@@ -254,6 +262,8 @@ typedef GLuint _glthread_Mutex;
#define _glthread_INIT_MUTEX(name) (void) name
+#define _glthread_DESTROY_MUTEX(name) (void) name
+
#define _glthread_LOCK_MUTEX(name) (void) name
#define _glthread_UNLOCK_MUTEX(name) (void) name