1 #ifndef _XBT_CONTEXT_PRIVATE_H
\r
2 #define _XBT_CONTEXT_PRIVATE_H
\r
4 #include "xbt/sysdep.h"
\r
5 #include "xbt/xbt_context.h"
\r
9 /* the following function pointers describe the interface that all context concepts must implement */
\r
11 typedef void (*xbt_pfn_context_free_t)(xbt_context_t); /* pointer type to the function used to destroy the specified context */
\r
12 typedef void (*xbt_pfn_context_kill_t)(xbt_context_t); /* pointer type to the function used to kill the specified context */
\r
13 typedef void (*xbt_pfn_context_schedule_t)(xbt_context_t); /* pointer type to the function used to resume the specified context */
\r
14 typedef void (*xbt_pfn_context_yield_t)(void); /* pointer type to the function used to yield the specified context */
\r
15 typedef void (*xbt_pfn_context_start_t)(xbt_context_t); /* pointer type to the function used to start the specified context */
\r
16 typedef void (*xbt_pfn_context_stop_t)(int); /* pointer type to the function used to stop the current context */
\r
18 /* each context concept must use this macro in its declaration */
\r
19 #define XBT_CTX_BASE_T \
\r
20 s_xbt_swag_hookup_t hookup; \
\r
22 void_f_pvoid_t cleanup_func; \
\r
23 void *cleanup_arg; \
\r
24 ex_ctx_t *exception; \
\r
26 xbt_main_func_t code; \
\r
29 void_f_pvoid_t startup_func; \
\r
30 void *startup_arg; \
\r
31 xbt_pfn_context_free_t free; \
\r
32 xbt_pfn_context_kill_t kill; \
\r
33 xbt_pfn_context_schedule_t schedule; \
\r
34 xbt_pfn_context_yield_t yield; \
\r
35 xbt_pfn_context_start_t start; \
\r
36 xbt_pfn_context_stop_t stop
\r
38 /* all other contexts derive from this structure */
\r
39 typedef struct s_xbt_context
\r
47 #ifdef CONTEXT_THREADS
\r
48 #include "xbt_thread_context.h" /* thread based context declarations */
\r
49 #elif !defined(WIN32)
\r
50 #include "xbt_ucontext.h" /* ucontext based context declarations */
\r
52 #error ERROR [__FILE__, line __LINE__]: no context based implementation specified.
\r
55 #include "xbt_jcontext.h" /* java thread based context declarations */
\r
57 #endif /* !_XBT_CONTEXT_PRIVATE_H */
\r