Changes in src/libcfa/concurrency/thread [17af7d1:348006f]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/thread
r17af7d1 r348006f 28 28 // Anything that is resumed is a coroutine. 29 29 trait is_thread(dtype T) { 30 void ^?{}(T* this);31 30 void main(T* this); 32 31 thread_desc* get_thread(T* this); 33 32 }; 34 33 35 #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->t; } void main(X* this) 36 35 37 36 forall( dtype T | is_thread(T) ) 38 37 static inline coroutine_desc* get_coroutine(T* this) { 39 return &get_thread(this)->c or;38 return &get_thread(this)->c; 40 39 } 41 40 42 41 static inline coroutine_desc* get_coroutine(thread_desc* this) { 43 return &this->c or;42 return &this->c; 44 43 } 45 44 … … 65 64 void ?{}( scoped(T)* this, P params ); 66 65 67 forall( dtype T | sized(T) | is_thread(T) )66 forall( dtype T | sized(T) | is_thread(T) | { void ^?{}(T*); } ) 68 67 void ^?{}( scoped(T)* this ); 69 68
Note:
See TracChangeset
for help on using the changeset viewer.