Changes in src/libcfa/concurrency/threads [8def349:bd98b58]
- File:
-
- 1 edited
-
src/libcfa/concurrency/threads (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/threads
r8def349 rbd98b58 27 27 // Anything that implements this trait can be resumed. 28 28 // Anything that is resumed is a coroutine. 29 trait is_thread(dtype T | sized(T)) {29 trait is_thread(dtype T /*| sized(T)*/) { 30 30 void main(T* this); 31 31 thread_h* get_thread(T* this); 32 /*void ?{}(T*); 33 void ^?{}(T*);*/ 32 34 }; 33 35 34 36 #define DECL_THREAD(X) static inline thread_h* get_thread(X* this) { return &this->t; } void main(X* this); 35 37 36 forall( dtype T | sized(T)| is_thread(T) )38 forall(otype T | is_thread(T) ) 37 39 static inline coroutine* get_coroutine(T* this) { 38 40 return &get_thread(this)->c; … … 53 55 // thread runner 54 56 // Structure that actually start and stop threads 55 forall( dtype T | sized(T)| is_thread(T) )57 forall(otype T | is_thread(T) ) 56 58 struct thread { 57 59 T handle; 58 60 }; 59 61 60 forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T*); })62 forall(otype T | is_thread(T) ) 61 63 void ?{}( thread(T)* this ); 62 64 63 forall( dtype T, ttype P | sized(T)| is_thread(T) | { void ?{}(T*, P); } )65 forall(otype T, ttype P | is_thread(T) | { void ?{}(T*, P); } ) 64 66 void ?{}( thread(T)* this, P params ); 65 67 66 forall( dtype T | sized(T) | is_thread(T) | { void ^?{}(T*); })68 forall(otype T | is_thread(T) ) 67 69 void ^?{}( thread(T)* this ); 68 70
Note:
See TracChangeset
for help on using the changeset viewer.