MCPcopy Create free account
hub / github.com/boostorg/build / GC_delete_thread

Function GC_delete_thread

v2/engine/boehm_gc/pthread_support.c:398–418  ·  view source on GitHub ↗

Delete a thread from GC_threads. We assume it is there. */ (The code intentionally traps if it wasn't.) */

Source from the content-addressed store, hash-verified

396/* Delete a thread from GC_threads. We assume it is there. */
397/* (The code intentionally traps if it wasn't.) */
398void GC_delete_thread(pthread_t id)
399{
400 int hv = NUMERIC_THREAD_ID(id) % THREAD_TABLE_SZ;
401 register GC_thread p = GC_threads[hv];
402 register GC_thread prev = 0;
403
404 GC_ASSERT(I_HOLD_LOCK());
405 while (!THREAD_EQUAL(p -> id, id)) {
406 prev = p;
407 p = p -> next;
408 }
409 if (prev == 0) {
410 GC_threads[hv] = p -> next;
411 } else {
412 prev -> next = p -> next;
413 }
414# ifdef GC_DARWIN_THREADS
415 mach_port_deallocate(mach_task_self(), p->stop_info.mach_thread);
416# endif
417 GC_INTERNAL_FREE(p);
418}
419
420/* If a thread has been joined, but we have not yet */
421/* been notified, then there may be more than one thread */

Callers 1

GC_unregister_my_threadFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected