summaryrefslogtreecommitdiff
path: root/kern/mutex/mutex_adaptive_i.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-04-18 21:45:12 +0200
committerRichard Braun <rbraun@sceen.net>2018-04-19 01:45:43 +0200
commit8790d75d93c7e06b7b93c1078260aaf1e4ea25ca (patch)
tree478eb3eb2607f1312d7b4e64cab23f3bcb0268ee /kern/mutex/mutex_adaptive_i.h
parent3640f94ee392b19de48360d2d026a7f581447049 (diff)
kern/atomic: remove shortcuts
These shortcuts just don't bring enough value.
Diffstat (limited to 'kern/mutex/mutex_adaptive_i.h')
-rw-r--r--kern/mutex/mutex_adaptive_i.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/kern/mutex/mutex_adaptive_i.h b/kern/mutex/mutex_adaptive_i.h
index 05e97640..b123251f 100644
--- a/kern/mutex/mutex_adaptive_i.h
+++ b/kern/mutex/mutex_adaptive_i.h
@@ -55,7 +55,8 @@ mutex_adaptive_lock_fast(struct mutex *mutex)
{
uintptr_t owner;
- owner = atomic_cas_acquire(&mutex->owner, 0, (uintptr_t)thread_self());
+ owner = atomic_cas(&mutex->owner, 0,
+ (uintptr_t)thread_self(), ATOMIC_ACQUIRE);
if (unlikely(owner != 0)) {
return EBUSY;
@@ -69,7 +70,8 @@ mutex_adaptive_unlock_fast(struct mutex *mutex)
{
uintptr_t owner;
- owner = atomic_cas_release(&mutex->owner, (uintptr_t)thread_self(), 0);
+ owner = atomic_cas(&mutex->owner, (uintptr_t)thread_self(),
+ 0, ATOMIC_RELEASE);
if (unlikely(owner & MUTEX_ADAPTIVE_CONTENDED)) {
return EBUSY;