summaryrefslogtreecommitdiff
path: root/kern/mutex_i.h
diff options
context:
space:
mode:
authorAgustina Arzille <avarzille@riseup.net>2017-05-05 04:01:13 -1000
committerRichard Braun <rbraun@sceen.net>2017-05-09 21:17:58 +0200
commitbcbe8dc991a9ec63f30d50ed4cca89fd9e6b7ff7 (patch)
tree389517510b8d19082d02f36453dbf68356b548fb /kern/mutex_i.h
parentb5864f82b9c0d8ea2e825e7d86bd8cdeb825f870 (diff)
Replace sequential consistency with more efficient orders
Diffstat (limited to 'kern/mutex_i.h')
-rw-r--r--kern/mutex_i.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/kern/mutex_i.h b/kern/mutex_i.h
index d80cab21..a4a40eb5 100644
--- a/kern/mutex_i.h
+++ b/kern/mutex_i.h
@@ -31,7 +31,7 @@
static inline unsigned int
mutex_lock_fast(struct mutex *mutex)
{
- return atomic_cas_seq_cst(&mutex->state, MUTEX_UNLOCKED, MUTEX_LOCKED);
+ return atomic_cas_acquire(&mutex->state, MUTEX_UNLOCKED, MUTEX_LOCKED);
}
static inline unsigned int
@@ -39,7 +39,7 @@ mutex_unlock_fast(struct mutex *mutex)
{
unsigned int state;
- state = atomic_swap_seq_cst(&mutex->state, MUTEX_UNLOCKED);
+ state = atomic_swap_release(&mutex->state, MUTEX_UNLOCKED);
assert((state == MUTEX_LOCKED) || (state == MUTEX_CONTENDED));
return state;
}