3#include "mos/platform/platform_defs.h"
38 const futex_word_t current_value = __atomic_load_n(futex, __ATOMIC_SEQ_CST);
40 if (current_value != expected)
103 mos_panic(
"insane number of threads to wake up (?): %zd", num_to_wake);
125 pr_dinfo2(futex,
"waking up %zd threads on lock key=" PTR_FMT, num_to_wake, key);
127 pr_dinfo2(futex,
"actually woke up %zd threads", real_wakeups);
static spinlock_t futex_list_lock
static futex_key_t futex_get_key(const futex_word_t *futex)
static list_head futex_list_head
#define LIST_HEAD_INIT(container)
MOSAPI void list_node_append(list_node_t *head, list_node_t *item)
#define list_foreach(t, v, h)
Iterate over a list.
#define list_node(element)
Get the ‘list_node’ of a list element. This is exactly the reverse of ‘list_entry’ above.
list_node_t list_head
A linked list head.
ptr_t mm_get_phys_addr(mm_context_t *ctx, ptr_t vaddr)
#define futex_wake(futex, val)
#define futex_wait(futex, val)
#define mos_panic(fmt,...)
#define pr_dinfo2(feat, fmt,...)
__nodiscard bool reschedule_for_waitlist(waitlist_t *waitlist)
#define spinlock_acquire(lock)
#define spinlock_release(lock)
size_t waitlist_wake(waitlist_t *list, size_t max_wakeups)
__BEGIN_DECLS void waitlist_init(waitlist_t *list)