23 #include "os-threads.h" 37 mutex_init(&m_handle);
43 mutex_destroy(&m_handle);
46 mutex_t* NativeHandle()
53 if (mutex_trylock(&m_handle))
63 mutex_lock(&m_handle);
69 if (mutex_trylock(&m_handle))
73 mutex_unlock(&m_handle);
76 mutex_unlock(&m_handle);
82 if (mutex_trylock(&m_handle))
84 for (
unsigned i = m_lockCount; i > 0; --i)
85 mutex_unlock(&m_handle);
87 mutex_unlock(&m_handle);
93 volatile unsigned m_lockCount;
117 if (m_mutex.TryLock())
133 if (m_mutex.TryLock())
146 if (m_mutex.TryLock())
148 for (
unsigned i = m_lockCount; i > 0; --i)
157 volatile unsigned m_lockCount;