34 #ifndef SC_COR_FIBER_H 35 #define SC_COR_FIBER_H 37 #if defined(_WIN32) || defined(WIN32) || defined(WIN64) 42 #if defined(__GNUC__) && __USING_SJLJ_EXCEPTIONS__ 44 struct SjLj_Function_Context {
45 struct SjLj_Function_Context *prev;
51 class sc_cor_pkg_fiber;
54 #if( defined(_MSC_VER) && _MSC_VER >= 1300 ) 55 typedef std::size_t size_t;
72 : m_stack_size( 0 ), m_fiber( 0 ), m_pkg( 0 )
74 # if defined(__GNUC__) && __USING_SJLJ_EXCEPTIONS__ 80 virtual ~sc_cor_fiber();
84 std::size_t m_stack_size;
87 sc_cor_pkg_fiber* m_pkg;
88 #if defined(__GNUC__) && __USING_SJLJ_EXCEPTIONS__ 89 struct SjLj_Function_Context m_eh;
96 sc_cor_fiber(
const sc_cor_fiber& );
97 sc_cor_fiber& operator = (
const sc_cor_fiber& );
107 class SC_API sc_cor_pkg_fiber
116 virtual ~sc_cor_pkg_fiber();
119 virtual sc_cor* create( std::size_t stack_size,
sc_cor_fn* fn,
void* arg );
122 virtual void yield( sc_cor* next_cor );
125 virtual void abort( sc_cor* next_cor );
128 virtual sc_cor* get_main();
132 static int instance_count;
138 sc_cor_pkg_fiber(
const sc_cor_pkg_fiber& );
139 sc_cor_pkg_fiber& operator = (
const sc_cor_pkg_fiber& );
Coroutine abstract base classes.
sc_cor_pkg_qt sc_cor_pkg_t
void() sc_cor_fn(void *)
Function type for creating coroutines.
class SC_API sc_simcontext