summaryrefslogtreecommitdiff
path: root/kern/mutex/mutex_plain_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_plain_i.h
parent3640f94ee392b19de48360d2d026a7f581447049 (diff)
kern/atomic: remove shortcuts
These shortcuts just don't bring enough value.
Diffstat (limited to 'kern/mutex/mutex_plain_i.h')
-rw-r--r--kern/mutex/mutex_plain_i.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/kern/mutex/mutex_plain_i.h b/kern/mutex/mutex_plain_i.h
index d28fd92b..a7928295 100644
--- a/kern/mutex/mutex_plain_i.h
+++ b/kern/mutex/mutex_plain_i.h
@@ -49,7 +49,8 @@ mutex_plain_lock_fast(struct mutex *mutex)
{
unsigned int state;
- state = atomic_cas_acquire(&mutex->state, MUTEX_UNLOCKED, MUTEX_LOCKED);
+ state = atomic_cas(&mutex->state, MUTEX_UNLOCKED,
+ MUTEX_LOCKED, ATOMIC_ACQUIRE);
if (unlikely(state != MUTEX_UNLOCKED)) {
return EBUSY;
@@ -63,7 +64,7 @@ mutex_plain_unlock_fast(struct mutex *mutex)
{
unsigned int state;
- state = atomic_swap_release(&mutex->state, MUTEX_UNLOCKED);
+ state = atomic_swap(&mutex->state, MUTEX_UNLOCKED, ATOMIC_RELEASE);
if (unlikely(state == MUTEX_CONTENDED)) {
return EBUSY;