MCPcopy Create free account
hub / github.com/F-Stack/f-stack / thread_zombie

Function thread_zombie

freebsd/kern/kern_thread.c:550–565  ·  view source on GitHub ↗

* Place an unused thread on the zombie list. */

Source from the content-addressed store, hash-verified

548 * Place an unused thread on the zombie list.
549 */
550void
551thread_zombie(struct thread *td)
552{
553 struct thread_domain_data *tdd;
554 struct thread *ztd;
555
556 tdd = &thread_domain_data[td->td_allocdomain];
557 ztd = atomic_load_ptr(&tdd->tdd_zombies);
558 for (;;) {
559 td->td_zombie = ztd;
560 if (atomic_fcmpset_rel_ptr((uintptr_t *)&tdd->tdd_zombies,
561 (uintptr_t *)&ztd, (uintptr_t)td))
562 break;
563 continue;
564 }
565}
566
567/*
568 * Release a thread that has exited after cpu_throw().

Callers 1

thread_stashFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected