diff options
author | Agustina Arzille <avarzille@riseup.net> | 2017-05-05 04:01:13 -1000 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2017-05-09 21:17:58 +0200 |
commit | bcbe8dc991a9ec63f30d50ed4cca89fd9e6b7ff7 (patch) | |
tree | 389517510b8d19082d02f36453dbf68356b548fb /kern/rtmutex_i.h | |
parent | b5864f82b9c0d8ea2e825e7d86bd8cdeb825f870 (diff) |
Replace sequential consistency with more efficient orders
Diffstat (limited to 'kern/rtmutex_i.h')
-rw-r--r-- | kern/rtmutex_i.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kern/rtmutex_i.h b/kern/rtmutex_i.h index d34fb5f4..2f2cc17f 100644 --- a/kern/rtmutex_i.h +++ b/kern/rtmutex_i.h @@ -57,7 +57,7 @@ rtmutex_lock_fast(struct rtmutex *rtmutex) owner = (uintptr_t)thread_self(); rtmutex_assert_owner_aligned(owner); - return atomic_cas_seq_cst(&rtmutex->owner, 0, owner); + return atomic_cas_acquire(&rtmutex->owner, 0, owner); } static inline uintptr_t @@ -67,7 +67,7 @@ rtmutex_unlock_fast(struct rtmutex *rtmutex) owner = (uintptr_t)thread_self(); rtmutex_assert_owner_aligned(owner); - prev_owner = atomic_cas_seq_cst(&rtmutex->owner, owner, 0); + prev_owner = atomic_cas_release(&rtmutex->owner, owner, 0); assert((prev_owner & RTMUTEX_OWNER_MASK) == owner); return prev_owner; } |