28 #ifndef SC_COR_FIBER_H
29 #define SC_COR_FIBER_H
31 #if defined(_WIN32) || defined(WIN32) || defined(WIN64)
36 #if defined(__GNUC__) && __USING_SJLJ_EXCEPTIONS__
38 struct SjLj_Function_Context {
39 struct SjLj_Function_Context *prev;
45 class sc_cor_pkg_fiber;
48 #if( defined(_MSC_VER) && _MSC_VER >= 1300 )
49 typedef std::size_t size_t;
66 : m_stack_size( 0 ), m_fiber( 0 ), m_pkg( 0 )
68 # if defined(__GNUC__) && __USING_SJLJ_EXCEPTIONS__
74 virtual ~sc_cor_fiber();
78 std::size_t m_stack_size;
81 sc_cor_pkg_fiber* m_pkg;
82 #if defined(__GNUC__) && __USING_SJLJ_EXCEPTIONS__
83 struct SjLj_Function_Context m_eh;
90 sc_cor_fiber(
const sc_cor_fiber& );
91 sc_cor_fiber& operator = (
const sc_cor_fiber& );
101 class sc_cor_pkg_fiber
107 sc_cor_pkg_fiber( sc_simcontext* simc );
110 virtual ~sc_cor_pkg_fiber();
113 virtual sc_cor* create( std::size_t stack_size,
sc_cor_fn* fn,
void* arg );
116 virtual void yield( sc_cor* next_cor );
119 virtual void abort( sc_cor* next_cor );
122 virtual sc_cor* get_main();
126 static int instance_count;
132 sc_cor_pkg_fiber(
const sc_cor_pkg_fiber& );
133 sc_cor_pkg_fiber& operator = (
const sc_cor_pkg_fiber& );
void( sc_cor_fn)(void *)
Function type for creating coroutines.
sc_cor_pkg_qt sc_cor_pkg_t