Changeset 228666c in mainline for uspace/lib/libc/generic/futex.c


Ignore:
Timestamp:
2010-02-20T18:41:53Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b03a666
Parents:
bc9da2a
Message:

introduce atomic_count_t as the explicit type of the internal value in atomic_t (this is probably better than the chaotic mix of int/long)
atomic_count_t is defined as unsigned, for signed semantics you can cast it to atomic_signed_t

File:
1 edited

Legend:

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

    rbc9da2a r228666c  
    6868int futex_down(futex_t *futex)
    6969{
    70         if (atomic_predec(futex) < 0)
     70        if ((atomic_signed_t) atomic_predec(futex) < 0)
    7171                return __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->count);
    7272
     
    8282int futex_up(futex_t *futex)
    8383{
    84         if (atomic_postinc(futex) < 0)
     84        if ((atomic_signed_t) atomic_postinc(futex) < 0)
    8585                return __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->count);
    8686               
Note: See TracChangeset for help on using the changeset viewer.