Changes in src/libcfa/concurrency/thread [cb0e6de:348006f]
- File:
-
- 1 edited
-
src/libcfa/concurrency/thread (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/thread
rcb0e6de r348006f 22 22 23 23 #include "coroutine" 24 #include "monitor"25 24 26 25 //----------------------------------------------------------------------------- … … 29 28 // Anything that is resumed is a coroutine. 30 29 trait is_thread(dtype T) { 31 void ^?{}(T* mutex this);32 30 void main(T* this); 33 31 thread_desc* get_thread(T* this); 34 32 }; 35 33 36 #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) 37 35 38 36 forall( dtype T | is_thread(T) ) 39 37 static inline coroutine_desc* get_coroutine(T* this) { 40 return &get_thread(this)->c or;38 return &get_thread(this)->c; 41 39 } 42 40 43 forall( dtype T | is_thread(T) ) 44 static inline monitor_desc* get_monitor(T * this) { 45 return &get_thread(this)->mon; 46 } 47 48 static inline coroutine_desc* get_coroutine(thread_desc * this) { 49 return &this->cor; 50 } 51 52 static inline monitor_desc* get_monitor(thread_desc * this) { 53 return &this->mon; 41 static inline coroutine_desc* get_coroutine(thread_desc* this) { 42 return &this->c; 54 43 } 55 44 … … 75 64 void ?{}( scoped(T)* this, P params ); 76 65 77 forall( dtype T | sized(T) | is_thread(T) )66 forall( dtype T | sized(T) | is_thread(T) | { void ^?{}(T*); } ) 78 67 void ^?{}( scoped(T)* this ); 79 68
Note:
See TracChangeset
for help on using the changeset viewer.