MCPcopy Create free account
hub / github.com/defold/defold / TEST

Function TEST

engine/dlib/src/test/test_mutex.cpp:41–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41TEST(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
57static void ThreadFunctionTryLock(void* arg)
58{

Callers

nothing calls this directly

Calls 8

dmAtomicGet32Function · 0.85
dmAtomicStore32Function · 0.85
NewFunction · 0.50
JoinFunction · 0.50
DeleteFunction · 0.50
SleepFunction · 0.50
TryLockFunction · 0.50
UnlockFunction · 0.50

Tested by

no test coverage detected