Changeset 2965d18 in mainline for uspace/lib/c/generic/futex.c
- Timestamp:
- 2018-07-30T20:15:38Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d4b7b29
- Parents:
- 8080262
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-30 19:53:13)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-30 20:15:38)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/futex.c
r8080262 r2965d18 43 43 44 44 //#define DPRINTF(...) kio_printf(__VA_ARGS__) 45 #define DPRINTF(...) ((void)0)45 #define DPRINTF(...) dummy_printf(__VA_ARGS__) 46 46 47 47 /** Initialize futex counter. … … 84 84 * They should compile to regular load/stores, but simple assignments 85 85 * would be UB by definition. 86 * The proper ordering is ensured by the surrounding futex operation. 86 87 */ 87 88 … … 94 95 assert(prev_owner == NULL); 95 96 __atomic_store_n(&futex->owner, self, __ATOMIC_RELAXED); 96 97 atomic_inc(&self->futex_locks);98 97 } 99 98 … … 104 103 __futex_assert_is_locked(futex, name); 105 104 __atomic_store_n(&futex->owner, NULL, __ATOMIC_RELAXED); 106 atomic_dec(&self->futex_locks);107 105 futex_up(futex); 108 106 } … … 117 115 118 116 __atomic_store_n(&futex->owner, self, __ATOMIC_RELAXED); 119 120 atomic_inc(&self->futex_locks);121 117 122 118 DPRINTF("Trylock on futex %s (%p) by fibril %p succeeded.\n", name, futex, self); … … 135 131 136 132 __futex_assert_is_locked(futex, name); 137 atomic_dec(&self->futex_locks);138 atomic_inc(&no->futex_locks);139 133 __atomic_store_n(&futex->owner, new_owner, __ATOMIC_RELAXED); 140 134 }
Note:
See TracChangeset
for help on using the changeset viewer.