MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / Sys_DestroyThread

Function Sys_DestroyThread

neo/sys/threads.cpp:300–327  ·  view source on GitHub ↗

================== Sys_DestroyThread ================== */

Source from the content-addressed store, hash-verified

298==================
299*/
300void Sys_DestroyThread(xthreadInfo& info) {
301 assert(info.threadHandle);
302
303 SDL_WaitThread(info.threadHandle, NULL);
304
305 info.name = NULL;
306 info.threadHandle = NULL;
307 info.threadId = 0;
308
309 Sys_EnterCriticalSection();
310
311 for (int i = 0; i < thread_count; i++) {
312 if (&info == thread[i]) {
313 thread[i] = NULL;
314
315 int j;
316 for (j = i + 1; j < thread_count; j++)
317 thread[j - 1] = thread[j];
318
319 thread[j - 1] = NULL;
320 thread_count--;
321
322 break;
323 }
324 }
325
326 Sys_LeaveCriticalSection( );
327}
328
329/*
330==================

Callers 2

ShutdownMethod · 0.50
ShutdownMethod · 0.50

Calls 2

Sys_EnterCriticalSectionFunction · 0.70
Sys_LeaveCriticalSectionFunction · 0.70

Tested by

no test coverage detected