Changeset d4e68a6 for libcfa/src/concurrency
- Timestamp:
- Jun 23, 2019, 3:55:32 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 9504a89
- Parents:
- dc33b5b
- Location:
- libcfa/src/concurrency
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/coroutine.hfa
rdc33b5b rd4e68a6 10 10 // Created On : Mon Nov 28 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 30 18:23:45 201813 // Update Count : 812 // Last Modified On : Fri Jun 21 17:49:39 2019 13 // Update Count : 9 14 14 // 15 15 … … 53 53 forall(dtype T | is_coroutine(T)) 54 54 void prime(T & cor); 55 56 static inline struct coroutine_desc * active_coroutine() { return TL_GET( this_thread )->curr_cor; } 55 57 56 58 //----------------------------------------------------------------------------- -
libcfa/src/concurrency/invoke.h
rdc33b5b rd4e68a6 10 10 // Created On : Tue Jan 17 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat May 19 08:23:21 201813 // Update Count : 3112 // Last Modified On : Sat Jun 22 18:19:13 2019 13 // Update Count : 40 14 14 // 15 15 … … 46 46 #ifdef __cforall 47 47 extern "Cforall" { 48 static inline struct thread_desc * 49 static inline struct __condition_criterion_t * 48 static inline struct thread_desc *& get_next( struct thread_desc & this ); 49 static inline struct __condition_criterion_t *& get_next( struct __condition_criterion_t & this ); 50 50 51 51 extern thread_local struct KernelThreadData { … … 199 199 #ifdef __cforall 200 200 extern "Cforall" { 201 static inline struct coroutine_desc * active_coroutine() { return TL_GET( this_thread )->curr_cor; } 202 static inline struct thread_desc * active_thread () { return TL_GET( this_thread ); } 203 static inline struct processor * active_processor() { return TL_GET( this_processor ); } // UNSAFE 204 205 static inline thread_desc * & get_next( thread_desc & this ) { 201 static inline thread_desc *& get_next( thread_desc & this ) { 206 202 return this.next; 207 203 } … … 210 206 return this.node.[next, prev]; 211 207 } 212 213 static inline struct __condition_criterion_t * & get_next( struct __condition_criterion_t & this );214 208 215 209 static inline void ?{}(__monitor_group_t & this) { -
libcfa/src/concurrency/kernel.cfa
rdc33b5b rd4e68a6 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Apr 9 16:11:46 201813 // Update Count : 2 412 // Last Modified On : Thu Jun 20 17:21:23 2019 13 // Update Count : 25 14 14 // 15 15 … … 907 907 void doregister( cluster * cltr, thread_desc & thrd ) { 908 908 lock (cltr->thread_list_lock __cfaabi_dbg_ctx2); 909 cltr->nthreads += 1; 909 910 push_front(cltr->threads, thrd); 910 911 unlock (cltr->thread_list_lock); … … 914 915 lock (cltr->thread_list_lock __cfaabi_dbg_ctx2); 915 916 remove(cltr->threads, thrd ); 917 cltr->nthreads -= 1; 916 918 unlock(cltr->thread_list_lock); 917 919 } … … 919 921 void doregister( cluster * cltr, processor * proc ) { 920 922 lock (cltr->proc_list_lock __cfaabi_dbg_ctx2); 923 cltr->nprocessors += 1; 921 924 push_front(cltr->procs, *proc); 922 925 unlock (cltr->proc_list_lock); … … 926 929 lock (cltr->proc_list_lock __cfaabi_dbg_ctx2); 927 930 remove(cltr->procs, *proc ); 931 cltr->nprocessors -= 1; 928 932 unlock(cltr->proc_list_lock); 929 933 } -
libcfa/src/concurrency/kernel.hfa
rdc33b5b rd4e68a6 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Apr 10 14:46:49 201813 // Update Count : 1 012 // Last Modified On : Sat Jun 22 11:39:17 2019 13 // Update Count : 16 14 14 // 15 15 … … 91 91 this.lock = NULL; 92 92 } 93 static inline void ^?{}(FinishAction & this) {}93 static inline void ^?{}(FinishAction &) {} 94 94 95 95 // Processor … … 176 176 __dllist_t(struct processor) procs; 177 177 __dllist_t(struct processor) idles; 178 179 // List of processors 178 unsigned int nprocessors; 179 180 // List of threads 180 181 __spinlock_t thread_list_lock; 181 182 __dllist_t(struct thread_desc) threads; 183 unsigned int nthreads; 182 184 183 185 // Link lists fields … … 200 202 } 201 203 204 static inline struct processor * active_processor() { return TL_GET( this_processor ); } // UNSAFE 205 static inline struct cluster * active_cluster () { return TL_GET( this_processor )->cltr; } 206 202 207 // Local Variables: // 203 208 // mode: c // -
libcfa/src/concurrency/thread.hfa
rdc33b5b rd4e68a6 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 29 14:07:11 201813 // Update Count : 412 // Last Modified On : Fri Jun 21 17:51:33 2019 13 // Update Count : 5 14 14 // 15 15 … … 91 91 void yield( unsigned times ); 92 92 93 static inline struct thread_desc * active_thread () { return TL_GET( this_thread ); } 94 93 95 // Local Variables: // 94 96 // mode: c //
Note: See TracChangeset
for help on using the changeset viewer.