diff options
-rw-r--r-- | kern/thread.c | 12 | ||||
-rw-r--r-- | kern/thread.h | 16 |
2 files changed, 14 insertions, 14 deletions
diff --git a/kern/thread.c b/kern/thread.c index d41c2390..d992de64 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -682,7 +682,7 @@ thread_main(void) assert(!cpu_intr_enabled()); assert(!thread_preempt_enabled()); - thread = thread_current(); + thread = thread_self(); cpu_intr_enable(); thread_preempt_enable(); @@ -711,7 +711,7 @@ thread_init(struct thread *thread, void *stack, const struct thread_attr *attr, if (attr == NULL) attr = &thread_default_attr; - task = (attr->task == NULL) ? thread_current()->task : attr->task; + task = (attr->task == NULL) ? thread_self()->task : attr->task; assert(task != NULL); name = (attr->name == NULL) ? task->name : attr->name; assert(name != NULL); @@ -854,7 +854,7 @@ thread_schedule(void) flags = cpu_intr_save(); runq = thread_runq_local(); - prev = thread_current(); + prev = thread_self(); prev->flags &= ~THREAD_RESCHEDULE; thread_runq_put_prev(runq, prev); next = thread_runq_get_next(runq); @@ -874,7 +874,7 @@ thread_intr_schedule(void) assert(!cpu_intr_enabled()); - thread = thread_current(); + thread = thread_self(); assert(thread != NULL); if ((thread->preempt == 0) && (thread->flags & THREAD_RESCHEDULE)) @@ -886,7 +886,7 @@ thread_preempt_schedule(void) { struct thread *thread; - thread = thread_current(); + thread = thread_self(); assert(thread != NULL); if ((thread->preempt == 0)) @@ -900,7 +900,7 @@ thread_tick(void) assert(!cpu_intr_enabled()); - thread = thread_current(); + thread = thread_self(); thread_preempt_disable(); thread_sched_ops[thread->sched_class].tick(thread_runq_local(), thread); thread_preempt_enable_no_resched(); diff --git a/kern/thread.h b/kern/thread.h index ac9ad6d8..a8f40e83 100644 --- a/kern/thread.h +++ b/kern/thread.h @@ -191,7 +191,7 @@ void thread_preempt_schedule(void); void thread_tick(void); static inline struct thread * -thread_current(void) +thread_self(void) { return structof(tcb_current(), struct thread, tcb); } @@ -205,7 +205,7 @@ thread_current(void) static inline int thread_pinned(void) { - return (thread_current()->pinned != 0); + return (thread_self()->pinned != 0); } static inline void @@ -213,7 +213,7 @@ thread_pin(void) { struct thread *thread; - thread = thread_current(); + thread = thread_self(); thread->pinned++; assert(thread->pinned != 0); barrier(); @@ -225,7 +225,7 @@ thread_unpin(void) struct thread *thread; barrier(); - thread = thread_current(); + thread = thread_self(); assert(thread->pinned != 0); thread->pinned--; } @@ -239,7 +239,7 @@ thread_unpin(void) static inline int thread_preempt_enabled(void) { - return (thread_current()->preempt == 0); + return (thread_self()->preempt == 0); } static inline void @@ -248,7 +248,7 @@ thread_preempt_enable_no_resched(void) struct thread *thread; barrier(); - thread = thread_current(); + thread = thread_self(); assert(thread->preempt != 0); thread->preempt--; } @@ -259,7 +259,7 @@ thread_preempt_enable(void) struct thread *thread; barrier(); - thread = thread_current(); + thread = thread_self(); assert(thread->preempt != 0); thread->preempt--; @@ -272,7 +272,7 @@ thread_preempt_disable(void) { struct thread *thread; - thread = thread_current(); + thread = thread_self(); thread->preempt++; assert(thread->preempt != 0); barrier(); |