summaryrefslogtreecommitdiff
path: root/kern/rtmutex.c
diff options
context:
space:
mode:
Diffstat (limited to 'kern/rtmutex.c')
-rw-r--r--kern/rtmutex.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/kern/rtmutex.c b/kern/rtmutex.c
index 6909ce18..fcf5f358 100644
--- a/kern/rtmutex.c
+++ b/kern/rtmutex.c
@@ -15,10 +15,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <assert.h>
#include <stddef.h>
#include <stdint.h>
-#include <kern/assert.h>
#include <kern/atomic.h>
#include <kern/rtmutex.h>
#include <kern/rtmutex_i.h>
@@ -29,7 +29,7 @@
static void
rtmutex_set_contended(struct rtmutex *rtmutex)
{
- atomic_or_acq_rel(&rtmutex->owner, RTMUTEX_CONTENDED);
+ atomic_or(&rtmutex->owner, RTMUTEX_CONTENDED, ATOMIC_RELEASE);
}
void
@@ -64,8 +64,7 @@ rtmutex_lock_slow(struct rtmutex *rtmutex)
turnstile_own(turnstile);
if (turnstile_empty(turnstile)) {
- /* TODO Review memory order */
- prev_owner = atomic_swap_acquire(&rtmutex->owner, owner);
+ prev_owner = atomic_swap(&rtmutex->owner, owner, ATOMIC_RELAXED);
assert(prev_owner == (owner | bits));
}