1 #ifndef _XBT_UCONTEXT_H
\r
2 #define _XBT_UCONTEXT_H
\r
4 #include "ucontext_stack.h" /* loads context system definitions */
\r
5 #include <ucontext.h> /* context relative declarations */
\r
6 #define STACK_SIZE 128*1024 /* lower this if you want to reduce the memory consumption */
\r
8 #ifndef _XBT_CONTEXT_FACTORY_T_DEFINED
\r
9 typedef struct s_xbt_context_factory* xbt_context_factory_t;
\r
10 #define _XBT_CONTEXT_FACTORY_T_DEFINED
\r
11 #endif /* !_XBT_CONTEXT_FACTORY_T_DEFINED */
\r
13 typedef struct s_xbt_ucontext
\r
16 ucontext_t uc; /* the thread that execute the code */
\r
17 char stack[STACK_SIZE]; /* the thread stack size */
\r
18 struct s_xbt_ucontext* prev; /* the previous thread */
\r
19 }s_xbt_ucontext_t,* xbt_ucontext_t;
\r
23 xbt_ucontext_factory_init(xbt_context_factory_t* factory);
\r
27 #endif /* !_XBT_UCONTEXT_H */
\r