diff options
| author | David Xu <davidxu@FreeBSD.org> | 2005-11-03 01:34:08 +0000 |
|---|---|---|
| committer | David Xu <davidxu@FreeBSD.org> | 2005-11-03 01:34:08 +0000 |
| commit | 44355392b440219f792eb3ba326fc3aa0a63bd1f (patch) | |
| tree | 2e7593b1e0b58fad914db0320d327f10c9f50256 /sys/kern/kern_thread.c | |
| parent | 9af9b983e10e5b2e0985524f99b8b306c907a2d8 (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_thread.c')
| -rw-r--r-- | sys/kern/kern_thread.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index e315baf2e26d..12be17b39414 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -1022,3 +1022,18 @@ thread_sleep_check(struct thread *td) } return (0); } + +struct thread * +thread_find(struct proc *p, lwpid_t tid) +{ + struct thread *td; + + PROC_LOCK_ASSERT(p, MA_OWNED); + mtx_lock_spin(&sched_lock); + FOREACH_THREAD_IN_PROC(p, td) { + if (td->td_tid == tid) + break; + } + mtx_unlock_spin(&sched_lock); + return (td); +} |
