Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/thread.hfa

    r3e2b9c9 r2d8f7b0  
    8484
    8585//-----------------------------------------------------------------------------
     86// Thread getters
     87static inline struct $thread * active_thread () { return TL_GET( this_thread ); }
     88
     89//-----------------------------------------------------------------------------
    8690// Scheduler API
    8791
     
    102106bool force_yield( enum __Preemption_Reason );
    103107
     108static inline void yield() {
     109        force_yield(__MANUAL_PREEMPTION);
     110}
     111
     112// Yield: yield N times
     113static inline void yield( unsigned times ) {
     114        for( times ) {
     115                yield();
     116        }
     117}
     118
    104119//----------
    105120// sleep: force thread to block and be rescheduled after Duration duration
Note: See TracChangeset for help on using the changeset viewer.