summaryrefslogtreecommitdiff
path: root/kern/thread.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2013-02-28 22:32:11 +0100
committerRichard Braun <rbraun@sceen.net>2013-02-28 22:32:11 +0100
commitd724d6a6170ec225317b53c7ba5b86fc03cef67c (patch)
tree293ffeda247ed1595540b3dc4d82b40500b6e9d2 /kern/thread.h
parent14da75b3c59178662442de0b14615952a0b777b5 (diff)
kern/thread: rename thread_current to thread_self
This is best explained by mentioning that the kernel attempts to provide a threading API similar to POSIX threads.
Diffstat (limited to 'kern/thread.h')
-rw-r--r--kern/thread.h16
1 files changed, 8 insertions, 8 deletions
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();