21 #ifndef __TBB_machine_H 22 #error Do not #include this internal file directly; use public TBB headers instead. 26 #define __TBB_Yield() sched_yield() 30 #include <sys/syscall.h> 32 #if defined(SYS_futex) 34 #define __TBB_USE_FUTEX 1 40 #define __TBB_FUTEX_WAIT FUTEX_WAIT 42 #define __TBB_FUTEX_WAIT 0 46 #define __TBB_FUTEX_WAKE FUTEX_WAKE 48 #define __TBB_FUTEX_WAKE 1 52 #error machine specific headers must be included after tbb_stddef.h 59 inline int futex_wait(
void *futex,
int comparand ) {
60 int r = syscall( SYS_futex,futex,__TBB_FUTEX_WAIT,comparand,NULL,NULL,0 );
63 __TBB_ASSERT( r==0||r==EWOULDBLOCK||(r==-1&&(e==EAGAIN||e==EINTR)),
"futex_wait failed." );
68 inline int futex_wakeup_one(
void *futex ) {
69 int r = ::syscall( SYS_futex,futex,__TBB_FUTEX_WAKE,1,NULL,NULL,0 );
70 __TBB_ASSERT( r==0||r==1,
"futex_wakeup_one: more than one thread woken up?" );
74 inline int futex_wakeup_all(
void *futex ) {
75 int r = ::syscall( SYS_futex,futex,__TBB_FUTEX_WAKE,INT_MAX,NULL,NULL,0 );
76 __TBB_ASSERT( r>=0,
"futex_wakeup_all: error in waking up threads" );
Definition: _flow_graph_async_msg_impl.h:32
The namespace tbb contains all components of the library.
Definition: parallel_for.h:44