diff options
author | Richard Braun <rbraun@sceen.net> | 2019-08-16 20:02:37 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2019-08-16 20:30:48 +0200 |
commit | 84d47c358b1d07b9155474d7075e082c52147ebc (patch) | |
tree | 0a97fbcfe7f56637e18afc9e1ba4cefa3cea1aa5 /kern/thread.h | |
parent | 27dbd3b2fdafd6e12bdef5f653532b2ca752a6f9 (diff) |
Replace some barrier()s with local atomic fences
Diffstat (limited to 'kern/thread.h')
-rw-r--r-- | kern/thread.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/kern/thread.h b/kern/thread.h index 0c8c1014..d77b35f3 100644 --- a/kern/thread.h +++ b/kern/thread.h @@ -43,6 +43,7 @@ #include <kern/init.h> #include <kern/cpumap.h> #include <kern/kernel.h> +#include <kern/latomic.h> #include <kern/macros.h> #include <kern/spinlock_types.h> #include <kern/turnstile_types.h> @@ -548,7 +549,7 @@ thread_pin(void) thread = thread_self(); thread->pin_level++; assert(thread->pin_level != 0); - barrier(); + latomic_fence(LATOMIC_ACQ_REL); } /* @@ -561,7 +562,7 @@ thread_unpin(void) { struct thread *thread; - barrier(); + latomic_fence(LATOMIC_ACQ_REL); thread = thread_self(); assert(thread->pin_level != 0); thread->pin_level--; @@ -595,7 +596,7 @@ thread_preempt_disable(void) thread = thread_self(); thread->preempt_level++; assert(thread->preempt_level != 0); - barrier(); + latomic_fence(LATOMIC_ACQ_REL); } /* @@ -613,7 +614,7 @@ thread_preempt_enable_no_resched(void) { struct thread *thread; - barrier(); + latomic_fence(LATOMIC_ACQ_REL); thread = thread_self(); assert(thread->preempt_level != 0); thread->preempt_level--; @@ -713,7 +714,7 @@ thread_intr_enter(void) thread->intr_level++; assert(thread->intr_level != 0); - barrier(); + latomic_fence(LATOMIC_ACQ_REL); } /* @@ -726,7 +727,7 @@ thread_intr_leave(void) { struct thread *thread; - barrier(); + latomic_fence(LATOMIC_ACQ_REL); thread = thread_self(); assert(thread->intr_level != 0); thread->intr_level--; |