Changeset 168c007 for src/libcfa/concurrency/thread
- Timestamp:
- Mar 21, 2017, 12:50:27 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:
- da6d4566, f5392c1
- Parents:
- 94a8123 (diff), e04b636 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/libcfa/concurrency/thread ¶
r94a8123 r168c007 28 28 // Anything that is resumed is a coroutine. 29 29 trait is_thread(dtype T) { 30 void ^?{}(T* this); 30 31 void main(T* this); 31 32 thread_desc* get_thread(T* this); 32 33 }; 33 34 34 #define DECL_THREAD(X) thread_desc* get_thread(X* this) { return &this-> t; } void main(X* this)35 #define DECL_THREAD(X) thread_desc* get_thread(X* this) { return &this->__thrd; } void main(X* this) 35 36 36 37 forall( dtype T | is_thread(T) ) 37 38 static inline coroutine_desc* get_coroutine(T* this) { 38 return &get_thread(this)->c ;39 return &get_thread(this)->cor; 39 40 } 40 41 41 42 static inline coroutine_desc* get_coroutine(thread_desc* this) { 42 return &this->c ;43 return &this->cor; 43 44 } 44 45 … … 64 65 void ?{}( scoped(T)* this, P params ); 65 66 66 forall( dtype T | sized(T) | is_thread(T) | { void ^?{}(T*); })67 forall( dtype T | sized(T) | is_thread(T) ) 67 68 void ^?{}( scoped(T)* this ); 68 69
Note: See TracChangeset
for help on using the changeset viewer.