Changeset 639e4fc for libcfa/src/concurrency/invoke.h
- Timestamp:
- Nov 10, 2022, 2:19:51 PM (18 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 1553a55, 71806e0
- Parents:
- a757ba1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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) {
Note: See TracChangeset
for help on using the changeset viewer.