1 #include "coregl_internal.h"
3 //////////////////////////////////////////////////////////////////////////
5 int mutex_init(Mutex *mt);
6 int mutex_lock(Mutex *mt);
7 int mutex_unlock(Mutex *mt);
8 int get_current_thread();
9 int set_current_thread_state(GLThreadState *tstate);
10 GLThreadState * get_current_thread_state();
11 //////////////////////////////////////////////////////////////////////////
13 static __thread GLThreadState *per_thread_state = NULL;
20 if (pthread_mutex_init(mt, NULL) == 0)
34 if (pthread_mutex_lock(mt) == 0)
43 mutex_unlock(Mutex *mt)
47 if (pthread_mutex_unlock(mt) == 0)
58 return pthread_self();
62 set_current_thread_state(GLThreadState *tstate)
64 per_thread_state = tstate;
69 get_current_thread_state()
71 return per_thread_state;