HelenOS sources
futex 53 uspace/lib/c/generic/io/kio.c futex_t futex;
futex 60 uspace/lib/c/generic/io/kio.c if (futex_initialize(&kio_buffer.futex, 1) != EOK)
futex 66 uspace/lib/c/generic/io/kio.c futex_destroy(&kio_buffer.futex);
futex 72 uspace/lib/c/generic/io/kio.c futex_down(&kio_buffer.futex);
futex 98 uspace/lib/c/generic/io/kio.c futex_up(&kio_buffer.futex);
futex 119 uspace/lib/c/generic/private/fibril.h futex_t futex;
futex 56 uspace/lib/c/generic/private/futex.h extern errno_t futex_initialize(futex_t *futex, int value);
futex 58 uspace/lib/c/generic/private/futex.h static inline errno_t futex_destroy(futex_t *futex)
futex 60 uspace/lib/c/generic/private/futex.h if (futex->whandle) {
futex 62 uspace/lib/c/generic/private/futex.h rc = __SYSCALL1(SYS_WAITQ_DESTROY, (sysarg_t) futex->whandle);
futex 63 uspace/lib/c/generic/private/futex.h futex->whandle = CAP_NIL;
futex 78 uspace/lib/c/generic/private/futex.h #define futex_lock(futex) __futex_lock((futex), #futex)
futex 79 uspace/lib/c/generic/private/futex.h #define futex_unlock(futex) __futex_unlock((futex), #futex)
futex 80 uspace/lib/c/generic/private/futex.h #define futex_trylock(futex) __futex_trylock((futex), #futex)
futex 82 uspace/lib/c/generic/private/futex.h #define futex_give_to(futex, new_owner) __futex_give_to((futex), (new_owner), #futex)
futex 83 uspace/lib/c/generic/private/futex.h #define futex_assert_is_locked(futex) __futex_assert_is_locked((futex), #futex)
futex 84 uspace/lib/c/generic/private/futex.h #define futex_assert_is_not_locked(futex) __futex_assert_is_not_locked((futex), #futex)
futex 98 uspace/lib/c/generic/private/futex.h static inline errno_t futex_allocate_waitq(futex_t *futex)
futex 100 uspace/lib/c/generic/private/futex.h return __SYSCALL1(SYS_WAITQ_CREATE, (sysarg_t) &futex->whandle);
futex 119 uspace/lib/c/generic/private/futex.h static inline errno_t futex_down_composable(futex_t *futex,
futex 124 uspace/lib/c/generic/private/futex.h assert(futex->whandle != CAP_NIL);
futex 126 uspace/lib/c/generic/private/futex.h if (atomic_fetch_sub_explicit(&futex->val, 1, memory_order_acquire) > 0)
futex 150 uspace/lib/c/generic/private/futex.h return __SYSCALL3(SYS_WAITQ_SLEEP, (sysarg_t) futex->whandle,
futex 163 uspace/lib/c/generic/private/futex.h static inline errno_t futex_up(futex_t *futex)
futex 165 uspace/lib/c/generic/private/futex.h if (atomic_fetch_add_explicit(&futex->val, 1, memory_order_release) < 0)
futex 166 uspace/lib/c/generic/private/futex.h return __SYSCALL1(SYS_WAITQ_WAKEUP, (sysarg_t) futex->whandle);
futex 171 uspace/lib/c/generic/private/futex.h static inline errno_t futex_down_timeout(futex_t *futex,
futex 179 uspace/lib/c/generic/private/futex.h errno_t rc = futex_down_composable(futex, expires);
futex 181 uspace/lib/c/generic/private/futex.h futex_up(futex);
futex 193 uspace/lib/c/generic/private/futex.h static inline bool futex_trydown(futex_t *futex)
futex 209 uspace/lib/c/generic/private/futex.h return futex_down_timeout(futex, &tv) == EOK;
futex 221 uspace/lib/c/generic/private/futex.h static inline errno_t futex_down(futex_t *futex)
futex 223 uspace/lib/c/generic/private/futex.h return futex_down_timeout(futex, NULL);
futex 55 uspace/lib/c/generic/thread/fibril_synch.c return futex_initialize(&m->futex, 1);
futex 60 uspace/lib/c/generic/thread/fibril_synch.c futex_destroy(&m->futex);
futex 70 uspace/lib/c/generic/thread/fibril_synch.c futex_lock(&m->futex);
futex 76 uspace/lib/c/generic/thread/fibril_synch.c if (futex_trylock(&m->futex)) {
futex 87 uspace/lib/c/generic/thread/fibril_synch.c futex_unlock(&m->futex);
futex 53 uspace/lib/c/generic/thread/futex.c errno_t futex_initialize(futex_t *futex, int val)
futex 55 uspace/lib/c/generic/thread/futex.c atomic_store_explicit(&futex->val, val, memory_order_relaxed);
futex 56 uspace/lib/c/generic/thread/futex.c futex->whandle = CAP_NIL;
futex 57 uspace/lib/c/generic/thread/futex.c return futex_allocate_waitq(futex);
futex 62 uspace/lib/c/generic/thread/futex.c void __futex_assert_is_locked(futex_t *futex, const char *name)
futex 64 uspace/lib/c/generic/thread/futex.c void *owner = atomic_load_explicit(&futex->owner, memory_order_relaxed);
futex 67 uspace/lib/c/generic/thread/futex.c DPRINTF("Assertion failed: %s (%p) is not locked by fibril %p (instead locked by fibril %p).\n", name, futex, self, owner);
futex 72 uspace/lib/c/generic/thread/futex.c void __futex_assert_is_not_locked(futex_t *futex, const char *name)
futex 74 uspace/lib/c/generic/thread/futex.c void *owner = atomic_load_explicit(&futex->owner, memory_order_relaxed);
futex 77 uspace/lib/c/generic/thread/futex.c DPRINTF("Assertion failed: %s (%p) is already locked by fibril %p.\n", name, futex, self);
futex 82 uspace/lib/c/generic/thread/futex.c void __futex_lock(futex_t *futex, const char *name)
futex 92 uspace/lib/c/generic/thread/futex.c DPRINTF("Locking futex %s (%p) by fibril %p.\n", name, futex, self);
futex 93 uspace/lib/c/generic/thread/futex.c __futex_assert_is_not_locked(futex, name);
futex 94 uspace/lib/c/generic/thread/futex.c futex_down(futex);
futex 96 uspace/lib/c/generic/thread/futex.c void *prev_owner = atomic_load_explicit(&futex->owner,
futex 99 uspace/lib/c/generic/thread/futex.c atomic_store_explicit(&futex->owner, self, memory_order_relaxed);
futex 102 uspace/lib/c/generic/thread/futex.c void __futex_unlock(futex_t *futex, const char *name)
futex 105 uspace/lib/c/generic/thread/futex.c DPRINTF("Unlocking futex %s (%p) by fibril %p.\n", name, futex, self);
futex 106 uspace/lib/c/generic/thread/futex.c __futex_assert_is_locked(futex, name);
futex 107 uspace/lib/c/generic/thread/futex.c atomic_store_explicit(&futex->owner, NULL, memory_order_relaxed);
futex 108 uspace/lib/c/generic/thread/futex.c futex_up(futex);
futex 111 uspace/lib/c/generic/thread/futex.c bool __futex_trylock(futex_t *futex, const char *name)
futex 114 uspace/lib/c/generic/thread/futex.c bool success = futex_trydown(futex);
futex 116 uspace/lib/c/generic/thread/futex.c void *owner = atomic_load_explicit(&futex->owner,
futex 120 uspace/lib/c/generic/thread/futex.c atomic_store_explicit(&futex->owner, self, memory_order_relaxed);
futex 122 uspace/lib/c/generic/thread/futex.c DPRINTF("Trylock on futex %s (%p) by fibril %p succeeded.\n", name, futex, self);
futex 124 uspace/lib/c/generic/thread/futex.c DPRINTF("Trylock on futex %s (%p) by fibril %p failed.\n", name, futex, self);
futex 130 uspace/lib/c/generic/thread/futex.c void __futex_give_to(futex_t *futex, void *new_owner, const char *name)
futex 134 uspace/lib/c/generic/thread/futex.c DPRINTF("Passing futex %s (%p) from fibril %p to fibril %p.\n", name, futex, self, no);
futex 136 uspace/lib/c/generic/thread/futex.c __futex_assert_is_locked(futex, name);
futex 137 uspace/lib/c/generic/thread/futex.c atomic_store_explicit(&futex->owner, new_owner, memory_order_relaxed);
HelenOS homepage, sources at GitHub