Changeset 639e4fc for libcfa/src
- Timestamp:
- Nov 10, 2022, 2:19:51 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 1553a55, 71806e0
- Parents:
- a757ba1
- Location:
- libcfa/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/defs.hfa
ra757ba1 r639e4fc 30 30 #ifdef __cforall 31 31 #define __cfa_anonymous_object(x) inline struct x 32 #define __cfa_dlink(x) struct { inline dlink(x); }33 32 #else 34 33 #define __cfa_anonymous_object(x) struct x __cfa_anonymous_object 35 #define __cfa_dlink(x) struct { struct x * next; struct x * back; }36 34 #endif 37 35 -
libcfa/src/concurrency/invoke.h
ra757ba1 r639e4fc 146 146 147 147 // Link lists fields 148 // instrusive link field for threads 148 // instrusive link field for threads in the ready-queue 149 149 struct __thread_desc_link { 150 150 struct thread$ * next; 151 151 volatile unsigned long long ts; 152 152 }; 153 154 // Link lists fields 155 // instrusive link field for threads in the user_link/cltr_link 156 struct __thread_user_link { 157 #ifdef __cforall 158 inline dlink(thread$); 159 #else 160 struct thread$ * next; struct thread$ * back; 161 #endif 162 }; 163 _Static_assert(sizeof(struct __thread_user_link) == 2 * sizeof(struct thread$ *), "__thread_user_link should be consistent in C and Cforall"); 153 164 154 165 struct thread$ { … … 197 208 // intrusive link fields, used for locks, monitors and any user defined data structure 198 209 // default link fields for dlist 199 __cfa_dlink(thread$)user_link;210 struct __thread_user_link user_link; 200 211 201 212 // secondary intrusive link fields, used for global cluster list 202 213 // default link fields for dlist 203 __cfa_dlink(thread$)cltr_link;214 struct __thread_user_link cltr_link; 204 215 205 216 // used to store state between clh lock/unlock … … 244 255 } 245 256 246 static inline tytagref( typeof(((struct thread$ *)0p)->cltr_link), dlink(thread$)) ?`inner( struct thread$ & this ) {247 typeof(this.cltr_link)& ib = this.cltr_link;257 static inline tytagref(struct __thread_user_link, dlink(thread$)) ?`inner( struct thread$ & this ) { 258 struct __thread_user_link & ib = this.cltr_link; 248 259 dlink(thread$) & b = ib`inner; 249 tytagref( typeof(this.cltr_link), dlink(thread$)) result = { b };260 tytagref(struct __thread_user_link, dlink(thread$)) result = { b }; 250 261 return result; 251 262 } 252 263 253 P9_EMBEDDED( typeof(((struct thread$ *)0p)->cltr_link), dlink(thread$))264 P9_EMBEDDED(struct __thread_user_link, dlink(thread$)) 254 265 255 266 static inline void ?{}(__monitor_group_t & this) { -
libcfa/src/concurrency/kernel.hfa
ra757ba1 r639e4fc 250 250 // List of threads 251 251 __spinlock_t thread_list_lock; 252 dlist(struct thread$, typeof(((struct thread$ *)0p)->cltr_link)) threads;252 dlist(struct thread$, struct __thread_user_link) threads; 253 253 unsigned int nthreads; 254 254 -
libcfa/src/concurrency/kernel/startup.cfa
ra757ba1 r639e4fc 377 377 register_tls( proc ); 378 378 379 // io_future_t future;380 // eventfd_t idle_buf;381 // proc->idle_wctx.ftr = &future;382 // proc->idle_wctx.rdbuf = &idle_buf;383 384 385 379 // SKULLDUGGERY: We want to create a context for the processor coroutine 386 380 // which is needed for the 2-step context switch. However, there is no reason … … 737 731 { 738 732 tytagref( dlink(thread$), dlink(thread$) ) ?`inner( thread$ & this ) = void; 739 with( DLINK_VIA( thread$, typeof(((struct thread$ *)0p)->cltr_link)) )733 with( DLINK_VIA( thread$, struct __thread_user_link ) ) 740 734 remove( thrd ); 741 735 cltr->nthreads -= 1;
Note: See TracChangeset
for help on using the changeset viewer.