Delete a thread from GC_threads. We assume it is there. */ (The code intentionally traps if it wasn't.) */
| 396 | /* Delete a thread from GC_threads. We assume it is there. */ |
| 397 | /* (The code intentionally traps if it wasn't.) */ |
| 398 | void 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 */ |
no outgoing calls
no test coverage detected