Changes in uspace/lib/c/include/futex.h [d5c1051:8d2dd7f2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/futex.h
rd5c1051 r8d2dd7f2 37 37 38 38 #include <atomic.h> 39 #include <errno.h>40 39 #include <libc.h> 41 40 … … 108 107 * @param futex Futex. 109 108 * 110 * @return trueif the futex was acquired.111 * @return falseif the futex was not acquired.109 * @return Non-zero if the futex was acquired. 110 * @return Zero if the futex was not acquired. 112 111 * 113 112 */ 114 static inline boolfutex_trydown(futex_t *futex)113 static inline int futex_trydown(futex_t *futex) 115 114 { 116 115 return cas(&futex->val, 1, 0); … … 122 121 * 123 122 * @return ENOENT if there is no such virtual address. 124 * @return EOK on success.125 * @return Error code from <errno.h> otherwise.123 * @return Zero in the uncontended case. 124 * @return Otherwise one of ESYNCH_OK_ATOMIC or ESYNCH_OK_BLOCKED. 126 125 * 127 126 */ … … 129 128 { 130 129 if ((atomic_signed_t) atomic_predec(&futex->val) < 0) 131 return (int)__SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->val.count);130 return __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->val.count); 132 131 133 return EOK;132 return 0; 134 133 } 135 134 … … 139 138 * 140 139 * @return ENOENT if there is no such virtual address. 141 * @return EOK on success. 142 * @return Error code from <errno.h> otherwise. 140 * @return Zero in the uncontended case. 143 141 * 144 142 */ … … 146 144 { 147 145 if ((atomic_signed_t) atomic_postinc(&futex->val) < 0) 148 return (int)__SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->val.count);146 return __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->val.count); 149 147 150 return EOK;148 return 0; 151 149 } 152 150
Note:
See TracChangeset
for help on using the changeset viewer.