Changes in src/libcfa/concurrency/thread [b10affd:399a908]
- File:
-
- 1 edited
-
src/libcfa/concurrency/thread (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/thread
rb10affd r399a908 20 20 21 21 #include "coroutine" 22 #include "kernel" 22 23 #include "monitor" 23 24 24 25 //----------------------------------------------------------------------------- 25 // Coroutine trait 26 // Anything that implements this trait can be resumed. 27 // Anything that is resumed is a coroutine. 26 // thread trait 28 27 trait is_thread(dtype T) { 29 28 void ^?{}(T& mutex this); … … 52 51 } 53 52 54 //extern thread_local thread_desc * volatile this_thread;53 extern struct cluster * mainCluster; 55 54 56 55 forall( dtype T | is_thread(T) ) … … 59 58 //----------------------------------------------------------------------------- 60 59 // Ctors and dtors 61 void ?{}(thread_desc& this); 62 void ^?{}(thread_desc& this); 60 void ?{}(thread_desc & this, const char * const name, struct cluster & cl, void * storage, size_t storageSize ); 61 void ^?{}(thread_desc & this); 62 63 static inline void ?{}(thread_desc & this) { this{ "Anonymous Thread", *mainCluster, NULL, 0 }; } 64 static inline void ?{}(thread_desc & this, size_t stackSize ) { this{ "Anonymous Thread", *mainCluster, NULL, stackSize }; } 65 static inline void ?{}(thread_desc & this, void * storage, size_t storageSize ) { this{ "Anonymous Thread", *mainCluster, storage, storageSize }; } 66 static inline void ?{}(thread_desc & this, struct cluster & cl ) { this{ "Anonymous Thread", cl, NULL, 0 }; } 67 static inline void ?{}(thread_desc & this, struct cluster & cl, size_t stackSize ) { this{ "Anonymous Thread", cl, 0, stackSize }; } 68 static inline void ?{}(thread_desc & this, struct cluster & cl, void * storage, size_t storageSize ) { this{ "Anonymous Thread", cl, storage, storageSize }; } 69 static inline void ?{}(thread_desc & this, const char * const name) { this{ name, *mainCluster, NULL, 0 }; } 70 static inline void ?{}(thread_desc & this, const char * const name, struct cluster & cl ) { this{ name, cl, NULL, 0 }; } 71 static inline void ?{}(thread_desc & this, const char * const name, struct cluster & cl, size_t stackSize ) { this{ name, cl, NULL, stackSize }; } 63 72 64 73 //-----------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.