Changeset d54b303 in mainline for uspace/lib/c/generic/thread.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/thread.c

    r9a3b469 rd54b303  
    4646#include "private/thread.h"
    4747
    48 /**
    49  * The number of threads that have been created and initialized since
    50  * the start of the program.
    51  */
    52 atomic_t _created_thread_cnt = {0};
     48#ifdef FUTEX_UPGRADABLE
     49#include <rcu.h>
     50#endif
     51
    5352
    5453/** Main thread function.
     
    6968        __tcb_set(fibril->tcb);
    7069       
    71         atomic_inc(&_created_thread_cnt);
     70#ifdef FUTEX_UPGRADABLE
     71        rcu_register_fibril();
     72        futex_upgrade_all_and_wait();
     73#endif
    7274       
    7375        uarg->uspace_thread_function(uarg->uspace_thread_arg);
     
    8183        /* If there is a manager, destroy it */
    8284        async_destroy_manager();
     85
     86#ifdef FUTEX_UPGRADABLE
     87        rcu_deregister_fibril();
     88#endif
     89       
    8390        fibril_teardown(fibril);
    8491       
Note: See TracChangeset for help on using the changeset viewer.