Changeset 28e58fd for src/libcfa/concurrency/thread
- Timestamp:
- Aug 25, 2017, 10:38:34 AM (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:
- 800d275
- Parents:
- af08051 (diff), 3eab308c (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
-
src/libcfa/concurrency/thread
raf08051 r28e58fd 27 27 // Anything that is resumed is a coroutine. 28 28 trait is_thread(dtype T) { 29 void ^?{}(T *mutex this);30 void main(T *this);31 thread_desc* get_thread(T *this);29 void ^?{}(T& mutex this); 30 void main(T& this); 31 thread_desc* get_thread(T& this); 32 32 }; 33 33 34 #define DECL_THREAD(X) thread_desc* get_thread(X * this) { return &this->__thrd; } void main(X*this)34 #define DECL_THREAD(X) thread_desc* get_thread(X& this) { return &this.__thrd; } void main(X& this) 35 35 36 36 forall( dtype T | is_thread(T) ) 37 static inline coroutine_desc* get_coroutine(T *this) {37 static inline coroutine_desc* get_coroutine(T & this) { 38 38 return &get_thread(this)->cor; 39 39 } 40 40 41 41 forall( dtype T | is_thread(T) ) 42 static inline monitor_desc* get_monitor(T *this) {42 static inline monitor_desc* get_monitor(T & this) { 43 43 return &get_thread(this)->mon; 44 44 } … … 55 55 56 56 forall( dtype T | is_thread(T) ) 57 void __thrd_start( T *this );57 void __thrd_start( T & this ); 58 58 59 59 //----------------------------------------------------------------------------- 60 60 // Ctors and dtors 61 void ?{}(thread_desc *this);62 void ^?{}(thread_desc *this);61 void ?{}(thread_desc& this); 62 void ^?{}(thread_desc& this); 63 63 64 64 //----------------------------------------------------------------------------- … … 70 70 }; 71 71 72 forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T *); } )73 void ?{}( scoped(T) *this );72 forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T&); } ) 73 void ?{}( scoped(T)& this ); 74 74 75 forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T *, P); } )76 void ?{}( scoped(T) *this, P params );75 forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T&, P); } ) 76 void ?{}( scoped(T)& this, P params ); 77 77 78 78 forall( dtype T | sized(T) | is_thread(T) ) 79 void ^?{}( scoped(T) *this );79 void ^?{}( scoped(T)& this ); 80 80 81 81 void yield();
Note:
See TracChangeset
for help on using the changeset viewer.