summaryrefslogtreecommitdiff
path: root/libcr_ipc/mutex.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-12 08:34:19 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-12 08:34:19 -0600
commitddd3f3982c6cdf8d7d0068e544cc9daf24355d32 (patch)
tree747821d810bf6ecb97089af088e3946cfc1225ce /libcr_ipc/mutex.c
parentd053a0f6dffc575611324b81acaef0d1554bda6c (diff)
parente0d67aeb886c75dde8f05120a2d8d1bd2dd2c16c (diff)
Merge branch 'lukeshu/tidy'
Diffstat (limited to 'libcr_ipc/mutex.c')
-rw-r--r--libcr_ipc/mutex.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libcr_ipc/mutex.c b/libcr_ipc/mutex.c
index 28debba..b0ebe05 100644
--- a/libcr_ipc/mutex.c
+++ b/libcr_ipc/mutex.c
@@ -9,10 +9,8 @@
#define IMPLEMENTATION_FOR_LIBCR_IPC_MUTEX_H YES
#include <libcr_ipc/mutex.h>
-#include "_linkedlist.h"
-
struct cr_mutex_waiter {
- cr_ipc_sll_node;
+ lm_sll_node;
cid_t cid;
};
@@ -26,7 +24,7 @@ void cr_mutex_lock(cr_mutex_t *mu) {
struct cr_mutex_waiter self = {
.cid = cr_getcid(),
};
- cr_ipc_sll_push_to_rear(&mu->waiters, &self);
+ lm_sll_push_to_rear(&mu->waiters, &self);
cr_pause_and_yield();
}
assert(mu->locked);
@@ -38,8 +36,8 @@ void cr_mutex_unlock(cr_mutex_t *mu) {
assert(mu->locked);
if (mu->waiters.front) {
- cr_unpause(cr_ipc_sll_node_cast(struct cr_mutex_waiter, mu->waiters.front)->cid);
- cr_ipc_sll_pop_from_front(&mu->waiters);
+ cr_unpause(lm_sll_node_cast(struct cr_mutex_waiter, mu->waiters.front)->cid);
+ lm_sll_pop_from_front(&mu->waiters);
} else
mu->locked = false;
}