#include "cthread.h"
#include <pthread.h>
#include <stdio.h>
Go to the source code of this file.
Defines |
| #define | GET_TLS() tls_thread |
| #define | SET_TLS(val) do { tls_thread = val; } while( 0 ); |
Typedefs |
| typedef void(* | MK_CTX_FUNC )(void) |
Functions |
| int | CTHREAD_libinit () |
| | library initialisation
|
| void | cthread_init (CTHREAD *arg) |
| CTHREAD * | CTHREAD_init (STACKS *stacks, CTHREAD_PROC proc) |
| | initialises a new co-routine thread.
|
| static int | do_start (CTHREAD *thread) |
| int | CTHREAD_start (CTHREAD *thread, VALUES **rvalue, const char *format,...) |
| | start a new thread - the thread procedure is invoked.
|
| int | CTHREAD_join (CTHREAD *thread, VALUES **rvalue) |
| | waits till the thread has finished Calls CTHREAD_resume repeatedly unntil the thread finishes.
|
| int | CTHREAD_resume (CTHREAD *thread, VALUES **rvalue, const char *format,...) |
| | resume a suspended thread
|
| int | CTHREAD_yield (VALUES **rvalue, const char *format,...) |
| | a running thread temporarily suspends execution
|
| int | CTHREAD_free (CTHREAD *thread) |
| uint32_t | CTHREAD_get_tid () |
| | get thread id
|
| int | CTHREAD_set_return_value (const char *format,...) |
| | a running thread sets it return values
|
Variables |
| __thread CTHREAD * | tls_thread |
| static uint32_t | next_tid |
Define Documentation
| #define SET_TLS |
( |
|
val | ) |
do { tls_thread = val; } while( 0 ); |
Typedef Documentation
Function Documentation
| static int do_start |
( |
CTHREAD * |
thread | ) |
[static] |
Variable Documentation