diff options
author | José Fonseca <jose.r.fonseca@gmail.com> | 2011-03-06 09:11:59 +0000 |
---|---|---|
committer | José Fonseca <jose.r.fonseca@gmail.com> | 2011-03-06 09:11:59 +0000 |
commit | b531b01b707370df2cf013fc18c70eda62f5b4be (patch) | |
tree | 9891787833c6fc6b7d3a8e7749edb72323bc0bfe /src/mapi/mapi/u_current.c | |
parent | e640eec9ba9e2ff0e462671f6a3c548d2e0c40cf (diff) |
mapi: _glthread_DECLARE_STATIC_MUTEX is not broken on Windows.
Diffstat (limited to 'src/mapi/mapi/u_current.c')
-rw-r--r-- | src/mapi/mapi/u_current.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/mapi/mapi/u_current.c b/src/mapi/mapi/u_current.c index 7946d2a274..21a07abbae 100644 --- a/src/mapi/mapi/u_current.c +++ b/src/mapi/mapi/u_current.c @@ -144,15 +144,7 @@ u_current_init_tsd(void) /** * Mutex for multithread check. */ -#ifdef WIN32 -/* _glthread_DECLARE_STATIC_MUTEX is broken on windows. There will be race! */ -#define CHECK_MULTITHREAD_LOCK() -#define CHECK_MULTITHREAD_UNLOCK() -#else u_mutex_declare_static(ThreadCheckMutex); -#define CHECK_MULTITHREAD_LOCK() u_mutex_lock(ThreadCheckMutex) -#define CHECK_MULTITHREAD_UNLOCK() u_mutex_unlock(ThreadCheckMutex) -#endif /** * We should call this periodically from a function such as glXMakeCurrent @@ -167,7 +159,7 @@ u_current_init(void) if (ThreadSafe) return; - CHECK_MULTITHREAD_LOCK(); + u_mutex_lock(ThreadCheckMutex); if (firstCall) { u_current_init_tsd(); @@ -179,7 +171,7 @@ u_current_init(void) u_current_set(NULL); u_current_set_user(NULL); } - CHECK_MULTITHREAD_UNLOCK(); + u_mutex_unlock(ThreadCheckMutex); } #else |