* Called from: * thread_exit() */
| 1014 | * thread_exit() |
| 1015 | */ |
| 1016 | void |
| 1017 | thread_unlink(struct thread *td) |
| 1018 | { |
| 1019 | struct proc *p = td->td_proc; |
| 1020 | |
| 1021 | PROC_LOCK_ASSERT(p, MA_OWNED); |
| 1022 | #ifdef EPOCH_TRACE |
| 1023 | MPASS(SLIST_EMPTY(&td->td_epochs)); |
| 1024 | #endif |
| 1025 | |
| 1026 | TAILQ_REMOVE(&p->p_threads, td, td_plist); |
| 1027 | p->p_numthreads--; |
| 1028 | /* could clear a few other things here */ |
| 1029 | /* Must NOT clear links to proc! */ |
| 1030 | } |
| 1031 | |
| 1032 | static int |
| 1033 | calc_remaining(struct proc *p, int mode) |