Changeset 927a181e in mainline for uspace/lib/c/generic/futex.c


Ignore:
Timestamp:
2012-12-04T02:17:04Z (12 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cb10bc9
Parents:
21b703f
Message:

Turned futex_t in uspace into an opaque type.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/futex.c

    r21b703f r927a181e  
    4646void futex_initialize(futex_t *futex, int val)
    4747{
    48         atomic_set(futex, val);
     48        atomic_set(&futex->val, val);
    4949}
    5050
     
    5959int futex_trydown(futex_t *futex)
    6060{
    61         return cas(futex, 1, 0);
     61        return cas(&futex->val, 1, 0);
    6262}
    6363
     
    7373int futex_down(futex_t *futex)
    7474{
    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);
    7777       
    7878        return 0;
     
    8989int futex_up(futex_t *futex)
    9090{
    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);
    9393       
    9494        return 0;
Note: See TracChangeset for help on using the changeset viewer.