Changeset 77e6fcb for src/libcfa
- Timestamp:
- Feb 1, 2017, 2:55:06 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- de90452
- Parents:
- 8761006c
- Location:
- src/libcfa/concurrency
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/coroutines
r8761006c r77e6fcb 30 30 }; 31 31 32 #define DECL_COROUTINE(X) static inline coroutine* get_coroutine(X* this) { return &this->c; } void main(X* this) ;32 #define DECL_COROUTINE(X) static inline coroutine* get_coroutine(X* this) { return &this->c; } void main(X* this) 33 33 34 34 //----------------------------------------------------------------------------- … … 110 110 } 111 111 112 static inline void resume(coroutine * dst) { 113 coroutine * src = this_coroutine(); // optimization 114 115 // not resuming self ? 116 if ( src != dst ) { 117 assertf( dst->notHalted , 118 "Attempt by coroutine %.256s (%p) to resume terminated coroutine %.256s (%p).\n" 119 "Possible cause is terminated coroutine's main routine has already returned.", 120 src->name, src, dst->name, dst ); 121 122 // set last resumer 123 dst->last = src; 124 } // if 125 126 // always done for performance testing 127 CoroutineCtxSwitch( src, dst ); 128 } 129 112 130 #endif //COROUTINES_H 113 131 -
src/libcfa/concurrency/kernel.c
r8761006c r77e6fcb 43 43 }; 44 44 45 DECL_COROUTINE(processorCtx_t) 45 DECL_COROUTINE(processorCtx_t); 46 46 47 47 #define KERNEL_STORAGE(T,X) static char X##_storage[sizeof(T)] -
src/libcfa/concurrency/threads
r8761006c r77e6fcb 32 32 }; 33 33 34 #define DECL_THREAD(X) thread* get_thread(X* this) { return &this->t; } void main(X* this) ;34 #define DECL_THREAD(X) thread* get_thread(X* this) { return &this->t; } void main(X* this) 35 35 36 36 forall( dtype T | is_thread(T) )
Note: See TracChangeset
for help on using the changeset viewer.