Changes in src/libcfa/concurrency/thread [348006f:17af7d1]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/thread
r348006f r17af7d1 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.