Changeset e84ab3d for libcfa/src/concurrency/thread.hfa
- Timestamp:
- Jul 5, 2021, 4:44:20 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 7f62b708
- Parents:
- ee23a8d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/thread.hfa
ree23a8d re84ab3d 29 29 void ^?{}(T& mutex this); 30 30 void main(T& this); 31 $thread* get_thread(T& this);31 thread$ * get_thread(T& this); 32 32 }; 33 33 … … 45 45 // Inline getters for threads/coroutines/monitors 46 46 forall( T & | is_thread(T) ) 47 static inline $coroutine* get_coroutine(T & this) __attribute__((const)) { return &get_thread(this)->self_cor; }47 static inline coroutine$ * get_coroutine(T & this) __attribute__((const)) { return &get_thread(this)->self_cor; } 48 48 49 49 forall( T & | is_thread(T) ) 50 static inline $monitor* get_monitor (T & this) __attribute__((const)) { return &get_thread(this)->self_mon; }50 static inline monitor$ * get_monitor (T & this) __attribute__((const)) { return &get_thread(this)->self_mon; } 51 51 52 static inline $coroutine* get_coroutine($thread* this) __attribute__((const)) { return &this->self_cor; }53 static inline $monitor * get_monitor ($thread* this) __attribute__((const)) { return &this->self_mon; }52 static inline coroutine$ * get_coroutine(thread$ * this) __attribute__((const)) { return &this->self_cor; } 53 static inline monitor$ * get_monitor (thread$ * this) __attribute__((const)) { return &this->self_mon; } 54 54 55 55 //----------------------------------------------------------------------------- … … 62 62 //----------------------------------------------------------------------------- 63 63 // Ctors and dtors 64 void ?{}( $thread& this, const char * const name, struct cluster & cl, void * storage, size_t storageSize );65 void ^?{}( $thread& this);64 void ?{}(thread$ & this, const char * const name, struct cluster & cl, void * storage, size_t storageSize ); 65 void ^?{}(thread$ & this); 66 66 67 static inline void ?{}( $thread& this) { this{ "Anonymous Thread", *mainCluster, 0p, 65000 }; }68 static inline void ?{}( $thread& this, size_t stackSize ) { this{ "Anonymous Thread", *mainCluster, 0p, stackSize }; }69 static inline void ?{}( $thread& this, void * storage, size_t storageSize ) { this{ "Anonymous Thread", *mainCluster, storage, storageSize }; }70 static inline void ?{}( $thread& this, struct cluster & cl ) { this{ "Anonymous Thread", cl, 0p, 65000 }; }71 static inline void ?{}( $thread& this, struct cluster & cl, size_t stackSize ) { this{ "Anonymous Thread", cl, 0p, stackSize }; }72 static inline void ?{}( $thread& this, struct cluster & cl, void * storage, size_t storageSize ) { this{ "Anonymous Thread", cl, storage, storageSize }; }73 static inline void ?{}( $thread& this, const char * const name) { this{ name, *mainCluster, 0p, 65000 }; }74 static inline void ?{}( $thread& this, const char * const name, struct cluster & cl ) { this{ name, cl, 0p, 65000 }; }75 static inline void ?{}( $thread& this, const char * const name, struct cluster & cl, size_t stackSize ) { this{ name, cl, 0p, stackSize }; }67 static inline void ?{}(thread$ & this) { this{ "Anonymous Thread", *mainCluster, 0p, 65000 }; } 68 static inline void ?{}(thread$ & this, size_t stackSize ) { this{ "Anonymous Thread", *mainCluster, 0p, stackSize }; } 69 static inline void ?{}(thread$ & this, void * storage, size_t storageSize ) { this{ "Anonymous Thread", *mainCluster, storage, storageSize }; } 70 static inline void ?{}(thread$ & this, struct cluster & cl ) { this{ "Anonymous Thread", cl, 0p, 65000 }; } 71 static inline void ?{}(thread$ & this, struct cluster & cl, size_t stackSize ) { this{ "Anonymous Thread", cl, 0p, stackSize }; } 72 static inline void ?{}(thread$ & this, struct cluster & cl, void * storage, size_t storageSize ) { this{ "Anonymous Thread", cl, storage, storageSize }; } 73 static inline void ?{}(thread$ & this, const char * const name) { this{ name, *mainCluster, 0p, 65000 }; } 74 static inline void ?{}(thread$ & this, const char * const name, struct cluster & cl ) { this{ name, cl, 0p, 65000 }; } 75 static inline void ?{}(thread$ & this, const char * const name, struct cluster & cl, size_t stackSize ) { this{ name, cl, 0p, stackSize }; } 76 76 77 77 struct thread_dtor_guard_t { … … 111 111 // Unpark a thread, if the thread is already blocked, schedule it 112 112 // if the thread is not yet block, signal that it should rerun immediately 113 void unpark( $thread* this );113 void unpark( thread$ * this ); 114 114 115 115 forall( T & | is_thread(T) )
Note: See TracChangeset
for help on using the changeset viewer.