MCPcopy Create free account
hub / github.com/devkitPro/libctru / RecursiveLock_TryLock

Function RecursiveLock_TryLock

libctru/source/synchronization.c:135–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135int RecursiveLock_TryLock(RecursiveLock* lock)
136{
137 u32 tag = (u32)getThreadLocalStorage();
138 if (lock->thread_tag != tag)
139 {
140 if (LightLock_TryLock(&lock->lock))
141 return 1; // Failure
142 lock->thread_tag = tag;
143 }
144 lock->counter ++;
145 return 0; // Success
146}
147
148void RecursiveLock_Unlock(RecursiveLock* lock)
149{

Callers 1

Calls 2

getThreadLocalStorageFunction · 0.85
LightLock_TryLockFunction · 0.85

Tested by

no test coverage detected