Changeset 6e569bf in mainline for uspace/lib/c/generic/futex.c
- Timestamp:
- 2018-06-26T18:11:24Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 70fae4e
- Parents:
- 8119363
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/futex.c
r8119363 r6e569bf 80 80 void __futex_lock(futex_t *futex, const char *name) 81 81 { 82 /* We use relaxed atomics to avoid violating C11 memory model. 82 /* 83 * We use relaxed atomics to avoid violating C11 memory model. 83 84 * They should compile to regular load/stores, but simple assignments 84 85 * would be UB by definition. … … 90 91 futex_down(futex); 91 92 92 void *prev_owner = __atomic_ exchange_n(&futex->owner, self, __ATOMIC_RELAXED);93 void *prev_owner = __atomic_load_n(&futex->owner, __ATOMIC_RELAXED); 93 94 assert(prev_owner == NULL); 95 __atomic_store_n(&futex->owner, self, __ATOMIC_RELAXED); 94 96 95 97 atomic_inc(&self->futex_locks);
Note:
See TracChangeset
for help on using the changeset viewer.