Changeset de6319f for src/libcfa/concurrency/thread
- Timestamp:
- Apr 26, 2018, 5:23:15 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- b9f383f
- Parents:
- 22bdc34
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/thread
r22bdc34 rde6319f 23 23 24 24 //----------------------------------------------------------------------------- 25 // Coroutine trait 26 // Anything that implements this trait can be resumed. 27 // Anything that is resumed is a coroutine. 25 // thread trait 28 26 trait is_thread(dtype T) { 29 27 void ^?{}(T& mutex this); … … 52 50 } 53 51 54 //extern thread_local thread_desc * volatile this_thread;52 extern struct cluster * mainCluster; 55 53 56 54 forall( dtype T | is_thread(T) ) … … 59 57 //----------------------------------------------------------------------------- 60 58 // Ctors and dtors 61 void ?{}(thread_desc& this); 62 void ^?{}(thread_desc& this); 59 void ?{}(thread_desc & this, const char * const name, struct cluster & cl, void * storage, size_t storageSize ); 60 void ^?{}(thread_desc & this); 61 62 static inline void ?{}(thread_desc & this) { this{ "Anonymous Thread", *mainCluster, NULL, 0 }; } 63 static inline void ?{}(thread_desc & this, size_t stackSize ) { this{ "Anonymous Thread", *mainCluster, NULL, stackSize }; } 64 static inline void ?{}(thread_desc & this, void * storage, size_t storageSize ) { this{ "Anonymous Thread", *mainCluster, storage, storageSize }; } 65 static inline void ?{}(thread_desc & this, struct cluster & cl ) { this{ "Anonymous Thread", cl, NULL, 0 }; } 66 static inline void ?{}(thread_desc & this, struct cluster & cl, size_t stackSize ) { this{ "Anonymous Thread", cl, 0, stackSize }; } 67 static inline void ?{}(thread_desc & this, struct cluster & cl, void * storage, size_t storageSize ) { this{ "Anonymous Thread", cl, storage, storageSize }; } 68 static inline void ?{}(thread_desc & this, const char * const name) { this{ name, *mainCluster, NULL, 0 }; } 69 static inline void ?{}(thread_desc & this, const char * const name, struct cluster & cl ) { this{ name, cl, NULL, 0 }; } 70 static inline void ?{}(thread_desc & this, const char * const name, struct cluster & cl, size_t stackSize ) { this{ name, cl, NULL, stackSize }; } 63 71 64 72 //-----------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.