Changes in uspace/lib/c/generic/futex.c [596d65c:63f8966] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/futex.c
r596d65c r63f8966 31 31 */ 32 32 /** @file 33 */ 33 */ 34 34 35 35 #include <futex.h> … … 40 40 /** Initialize futex counter. 41 41 * 42 * @param futex Futex. 43 * @param val Initialization value. 44 * 42 * @param futex Futex. 43 * @param val Initialization value. 45 44 */ 46 45 void futex_initialize(futex_t *futex, int val) … … 51 50 /** Try to down the futex. 52 51 * 53 * @param futex Futex. 54 * 55 * @return Non-zero if the futex was acquired. 56 * @return Zero if the futex was not acquired. 57 * 52 * @param futex Futex. 53 * @return Non-zero if the futex was acquired. 54 * @return Zero if the futex was not acquired. 58 55 */ 59 56 int futex_trydown(futex_t *futex) … … 64 61 /** Down the futex. 65 62 * 66 * @param futex Futex. 67 * 68 * @return ENOENT if there is no such virtual address. 69 * @return Zero in the uncontended case. 70 * @return Otherwise one of ESYNCH_OK_ATOMIC or ESYNCH_OK_BLOCKED. 71 * 63 * @param futex Futex. 64 * @return ENOENT if there is no such virtual address. 65 * @return Zero in the uncontended case. 66 * @return Otherwise one of ESYNCH_OK_ATOMIC or ESYNCH_OK_BLOCKED. 72 67 */ 73 68 int futex_down(futex_t *futex) … … 75 70 if ((atomic_signed_t) atomic_predec(futex) < 0) 76 71 return __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->count); 77 72 78 73 return 0; 79 74 } … … 81 76 /** Up the futex. 82 77 * 83 * @param futex Futex. 84 * 85 * @return ENOENT if there is no such virtual address. 86 * @return Zero in the uncontended case. 87 * 78 * @param futex Futex. 79 * @return ENOENT if there is no such virtual address. 80 * @return Zero in the uncontended case. 88 81 */ 89 82 int futex_up(futex_t *futex) … … 91 84 if ((atomic_signed_t) atomic_postinc(futex) < 0) 92 85 return __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->count); 93 86 94 87 return 0; 95 88 }
Note:
See TracChangeset
for help on using the changeset viewer.