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

Function CondVar_EndWait

libctru/source/synchronization.c:166–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166static inline bool CondVar_EndWait(CondVar* cv, s32 num_threads)
167{
168 bool hasWaiters;
169 s32 val;
170
171 do {
172 val = __ldrex(cv);
173 hasWaiters = val < 0;
174 if (hasWaiters)
175 {
176 if (num_threads < 0)
177 val = 0;
178 else if (val <= -num_threads)
179 val += num_threads;
180 else
181 val = 0;
182 }
183 } while (__strex(cv, val));
184
185 return hasWaiters;
186}
187
188void CondVar_Init(CondVar* cv)
189{

Callers 2

CondVar_WaitTimeoutFunction · 0.85
CondVar_WakeUpFunction · 0.85

Calls 2

__ldrexFunction · 0.85
__strexFunction · 0.85

Tested by

no test coverage detected