Go to the source code of this file.
◆ CoreMutex
◆ CoreMutex
◆ CoreMutex_Init()
◆ CoreMutex_Lock()
Definition at line 16 of file mutex.c.
17{
18 while (__sync_lock_test_and_set(&mtx->
lock, 1) == 1) {
20 }
21}
int OSThreadSleep(uint64_t time)
◆ CoreMutex_TryLock()
Definition at line 24 of file mutex.c.
25{
26 if (__sync_lock_test_and_set(&mtx->
lock, 1) == 1) {
27 return false;
28 } else {
29 return true;
30 }
31}
◆ CoreMutex_Unlock()
Definition at line 34 of file mutex.c.
35{
36 __sync_lock_release(&mtx->
lock);
37}