diff options
Diffstat (limited to 'kern/thread.c')
-rw-r--r-- | kern/thread.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kern/thread.c b/kern/thread.c index 79199a8f..3b6ed3a0 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -2908,6 +2908,15 @@ thread_key_create(unsigned int *keyp, thread_dtor_fn_t dtor) } unsigned int +thread_cpu(const struct thread *thread) +{ + const struct thread_runq *runq; + + runq = atomic_load(&thread->runq, ATOMIC_RELAXED); + return runq->cpu; +} + +unsigned int thread_state(const struct thread *thread) { return atomic_load(&thread->state, ATOMIC_RELAXED); |