Changeset d54b303 in mainline for uspace/lib/c/generic/futex.c


Ignore:
Timestamp:
2012-12-04T05:18:19Z (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:
32d2e60
Parents:
9a3b469
Message:

Initial version of nop futexes that are upgradable to proper futexes.

File:
1 edited

Legend:

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

    r9a3b469 rd54b303  
    4848
    4949
     50#ifdef FUTEX_UPGRADABLE
     51
     52int _upgrade_futex = 0;
     53static futex_t upg_and_wait_futex = FUTEX_INITIALIZER;
     54
     55void futex_upgrade_all_and_wait(void)
     56{
     57        _futex_down(&upg_and_wait_futex);
     58       
     59        if (!_upgrade_futex) {
     60                rcu_assign(_upgrade_futex, 1);
     61                rcu_synchronize();
     62        }
     63       
     64        _futex_up(&upg_and_wait_futex);
     65}
     66
     67#endif
     68
    5069/** @}
    5170 */
Note: See TracChangeset for help on using the changeset viewer.