Changeset 0c92c9f for src/libcfa/concurrency/threads
- Timestamp:
- Jan 27, 2017, 4:28:05 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:
- 8804701
- Parents:
- 0157ca7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/threads
r0157ca7 r0c92c9f 27 27 // Anything that implements this trait can be resumed. 28 28 // Anything that is resumed is a coroutine. 29 trait is_thread(dtype T | sized(T)) {29 trait is_thread(dtype T) { 30 30 void main(T* this); 31 31 thread* get_thread(T* this); 32 32 }; 33 33 34 #define DECL_THREAD(X) static inlinethread* 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 forall( dtype T | sized(T) |is_thread(T) )36 forall( dtype T | is_thread(T) ) 37 37 static inline coroutine* get_coroutine(T* this) { 38 38 return &get_thread(this)->c;
Note: See TracChangeset
for help on using the changeset viewer.