Changeset 927a181e in mainline for uspace/lib/c/generic/futex.c
- Timestamp:
- 2012-12-04T02:17:04Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cb10bc9
- Parents:
- 21b703f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/futex.c
r21b703f r927a181e 46 46 void futex_initialize(futex_t *futex, int val) 47 47 { 48 atomic_set( futex, val);48 atomic_set(&futex->val, val); 49 49 } 50 50 … … 59 59 int futex_trydown(futex_t *futex) 60 60 { 61 return cas( futex, 1, 0);61 return cas(&futex->val, 1, 0); 62 62 } 63 63 … … 73 73 int futex_down(futex_t *futex) 74 74 { 75 if ((atomic_signed_t) atomic_predec( futex) < 0)76 return __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex-> count);75 if ((atomic_signed_t) atomic_predec(&futex->val) < 0) 76 return __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->val.count); 77 77 78 78 return 0; … … 89 89 int futex_up(futex_t *futex) 90 90 { 91 if ((atomic_signed_t) atomic_postinc( futex) < 0)92 return __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex-> count);91 if ((atomic_signed_t) atomic_postinc(&futex->val) < 0) 92 return __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->val.count); 93 93 94 94 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.