Ignore:
File:
1 edited

Legend:

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

    r063a74b9 r9d58539  
    3535#include <futex.h>
    3636#include <atomic.h>
    37 #include <libarch/barrier.h>
    3837#include <libc.h>
    3938#include <sys/types.h>
     
    6059int futex_trydown(futex_t *futex)
    6160{
    62         int rc;
    63 
    64         rc = cas(futex, 1, 0);
    65         CS_ENTER_BARRIER();
    66 
    67         return rc;
     61        return cas(futex, 1, 0);
    6862}
    6963
     
    7973int futex_down(futex_t *futex)
    8074{
    81         atomic_signed_t nv;
    82 
    83         nv = (atomic_signed_t) atomic_predec(futex);
    84         CS_ENTER_BARRIER();
    85         if (nv < 0)
     75        if ((atomic_signed_t) atomic_predec(futex) < 0)
    8676                return __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->count);
    8777       
     
    9989int futex_up(futex_t *futex)
    10090{
    101         CS_LEAVE_BARRIER();
    102 
    10391        if ((atomic_signed_t) atomic_postinc(futex) < 0)
    10492                return __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->count);
Note: See TracChangeset for help on using the changeset viewer.