Ignore:
File:
1 edited

Legend:

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

    r596d65c r63f8966  
    3131 */
    3232/** @file
    33  */
     33 */ 
    3434
    3535#include <futex.h>
     
    4040/** Initialize futex counter.
    4141 *
    42  * @param futex Futex.
    43  * @param val   Initialization value.
    44  *
     42 * @param futex         Futex.
     43 * @param val           Initialization value.
    4544 */
    4645void futex_initialize(futex_t *futex, int val)
     
    5150/** Try to down the futex.
    5251 *
    53  * @param futex Futex.
    54  *
    55  * @return Non-zero if the futex was acquired.
    56  * @return Zero if the futex was not acquired.
    57  *
     52 * @param futex         Futex.
     53 * @return              Non-zero if the futex was acquired.
     54 * @return              Zero if the futex was not acquired.
    5855 */
    5956int futex_trydown(futex_t *futex)
     
    6461/** Down the futex.
    6562 *
    66  * @param futex Futex.
    67  *
    68  * @return ENOENT if there is no such virtual address.
    69  * @return Zero in the uncontended case.
    70  * @return Otherwise one of ESYNCH_OK_ATOMIC or ESYNCH_OK_BLOCKED.
    71  *
     63 * @param futex         Futex.
     64 * @return              ENOENT if there is no such virtual address.
     65 * @return              Zero in the uncontended case.
     66 * @return              Otherwise one of ESYNCH_OK_ATOMIC or ESYNCH_OK_BLOCKED.
    7267 */
    7368int futex_down(futex_t *futex)
     
    7570        if ((atomic_signed_t) atomic_predec(futex) < 0)
    7671                return __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->count);
    77        
     72
    7873        return 0;
    7974}
     
    8176/** Up the futex.
    8277 *
    83  * @param futex Futex.
    84  *
    85  * @return ENOENT if there is no such virtual address.
    86  * @return Zero in the uncontended case.
    87  *
     78 * @param futex         Futex.
     79 * @return              ENOENT if there is no such virtual address.
     80 * @return              Zero in the uncontended case.
    8881 */
    8982int futex_up(futex_t *futex)
     
    9184        if ((atomic_signed_t) atomic_postinc(futex) < 0)
    9285                return __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->count);
    93        
     86               
    9487        return 0;
    9588}
Note: See TracChangeset for help on using the changeset viewer.