Lines Matching full:mutex
21 * \brief Unix implementation of mutex.
32 /* \todo [2009-11-12 pyry] It is quite nasty to allocate mutex structs from heap. */
40 pthread_mutex_t* mutex = deMalloc(sizeof(pthread_mutex_t));
42 if (!mutex)
47 deFree(mutex);
58 deFree(mutex);
69 deFree(mutex);
75 ret = pthread_mutex_init(mutex, &attr);
79 deFree(mutex);
85 return (deMutex)mutex;
88 void deMutex_destroy (deMutex mutex)
90 pthread_mutex_t* pMutex = (pthread_mutex_t*)mutex;
96 void deMutex_lock (deMutex mutex)
98 int ret = pthread_mutex_lock((pthread_mutex_t*)mutex);
103 void deMutex_unlock (deMutex mutex)
105 int ret = pthread_mutex_unlock((pthread_mutex_t*)mutex);
110 deBool deMutex_tryLock (deMutex mutex)
112 return (pthread_mutex_trylock((pthread_mutex_t*)mutex) == 0);