| 39 | } |
| 40 | |
| 41 | TEST(Mutex, Basic) |
| 42 | { |
| 43 | ThreadArg a; |
| 44 | a.m_Value = 0; |
| 45 | a.m_Mutex = dmMutex::New(); |
| 46 | |
| 47 | dmThread::Thread t1 = dmThread::New(&ThreadFunctionBasic, 0x80000, &a, "t1"); |
| 48 | dmThread::Thread t2 = dmThread::New(&ThreadFunctionBasic, 0x80000, &a, "t2"); |
| 49 | |
| 50 | dmThread::Join(t1); |
| 51 | dmThread::Join(t2); |
| 52 | dmMutex::Delete(a.m_Mutex); |
| 53 | |
| 54 | ASSERT_EQ((uint32_t) 10000*2, a.m_Value); |
| 55 | } |
| 56 | |
| 57 | static void ThreadFunctionTryLock(void* arg) |
| 58 | { |
nothing calls this directly
no test coverage detected