MCPcopy Create free account
hub / github.com/ConfettiFX/The-Forge / threadSystemExit

Function threadSystemExit

Common_3/Utilities/Threading/ThreadSystem.c:267–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267void threadSystemExit(ThreadSystem* thandle, const struct ThreadSystemExitDesc* desc)
268{
269 struct ThreadSystemData* t = *thandle;
270 if (!t)
271 return;
272 *thandle = NULL;
273
274 acquireMutex(&t->mutex);
275 t->stop = true;
276 if (desc->abandonTasks)
277 t->stopAbandon = true;
278 wakeAllConditionVariable(&t->conditionTasks);
279 releaseMutex(&t->mutex);
280
281 if (!desc->detachThreads)
282 {
283 for (uint64_t ti = 0; ti < t->threadCount; ++ti)
284 joinThread(t->threads[ti]);
285 }
286 else
287 {
288 for (uint64_t ti = 0; ti < t->threadCount; ++ti)
289 detachThread(t->threads[ti]);
290 }
291
292 releaseThreadSystemHandle(t);
293}
294
295void threadSystemAddTasks(ThreadSystem thandle, TaskFunc func, uint64_t count, uint64_t userSize, void* users)
296{

Callers 8

exitMethod · 0.85
ExitMethod · 0.85
ExitMethod · 0.85
ExitMethod · 0.85
ExitMethod · 0.85
ExitMethod · 0.85
ExitMethod · 0.85

Calls 6

acquireMutexFunction · 0.50
wakeAllConditionVariableFunction · 0.50
releaseMutexFunction · 0.50
joinThreadFunction · 0.50
detachThreadFunction · 0.50

Tested by

no test coverage detected