Go to the documentation of this file. 59 typedef unsigned int semaphore_t;
73 #define CORO_CONTEXT( name ) \ 76 #define CORO_CONTEXT_INIT( name ) ({ \ 83 #define CORO_LOCAL static 89 #define CORO_DEFINE( name ) \ 90 int coro_##name( co_t *co_p ) 96 #define CORO_BEGIN( initial ) ({ \ 98 if ( *co_p ) goto **co_p; \ 106 #define CORO_END( final ) ({ \ 118 #define CORO_YIELD( final ) ({ \ 131 #define CORO_WAIT( cond, ... ) ({ \ 145 #define CORO_RESTART( final ) ({ \ 155 #define CORO_QUIT( final ) CORO_END( final ) 161 #define CORO_CALL( name ) \ 162 coro_##name( &co_##name ) 169 #define CORO_ALIVE( coro ) (( coro ) < CO_END ) 176 #define CORO_WAIT_CORO( coro, ... ) \ 177 CORO_WAIT( !CORO_ALIVE( coro ), ## __VA_ARGS__ ) 184 #define SEMAPHORE_INIT( name, val ) ({ \ 193 #define SEMAPHORE_ACQUIRE( name, ... ) ({ \ 194 CORO_WAIT(( name > 0 ), ## __VA_ARGS__ ); \ 202 #define SEMAPHORE_RELEASE( name ) ({ \