Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/futex.h

    rd5c1051 r8d2dd7f2  
    3737
    3838#include <atomic.h>
    39 #include <errno.h>
    4039#include <libc.h>
    4140
     
    108107 * @param futex Futex.
    109108 *
    110  * @return true if the futex was acquired.
    111  * @return false if the futex was not acquired.
     109 * @return Non-zero if the futex was acquired.
     110 * @return Zero if the futex was not acquired.
    112111 *
    113112 */
    114 static inline bool futex_trydown(futex_t *futex)
     113static inline int futex_trydown(futex_t *futex)
    115114{
    116115        return cas(&futex->val, 1, 0);
     
    122121 *
    123122 * @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.
    126125 *
    127126 */
     
    129128{
    130129        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);
    132131       
    133         return EOK;
     132        return 0;
    134133}
    135134
     
    139138 *
    140139 * @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.
    143141 *
    144142 */
     
    146144{
    147145        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);
    149147       
    150         return EOK;
     148        return 0;
    151149}
    152150
Note: See TracChangeset for help on using the changeset viewer.