Changes in libcfa/src/concurrency/invoke.h [639e4fc:f835806]
- File:
-
- 1 edited
-
libcfa/src/concurrency/invoke.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/invoke.h
r639e4fc rf835806 146 146 147 147 // Link lists fields 148 // instrusive link field for threads in the ready-queue148 // instrusive link field for threads 149 149 struct __thread_desc_link { 150 150 struct thread$ * next; 151 151 volatile unsigned long long ts; 152 152 }; 153 154 // Link lists fields155 // instrusive link field for threads in the user_link/cltr_link156 struct __thread_user_link {157 #ifdef __cforall158 inline dlink(thread$);159 #else160 struct thread$ * next; struct thread$ * back;161 #endif162 };163 _Static_assert(sizeof(struct __thread_user_link) == 2 * sizeof(struct thread$ *), "__thread_user_link should be consistent in C and Cforall");164 153 165 154 struct thread$ { … … 170 159 // Link lists fields 171 160 // instrusive link field for threads 172 struct __thread_desc_link rdy_link;161 struct __thread_desc_link link; 173 162 174 163 // current execution status for coroutine … … 206 195 struct __monitor_group_t monitors; 207 196 208 // intrusive link fields, used for locks, monitors and any user defineddata structure209 // default link fields for dlist210 struct __thread_user_link user_link; 211 212 // secondary intrusive link fields, used for global cluster list213 // default link fields for dlist214 struct __thread_user_link cltr_link;197 // used to put threads on dlist data structure 198 __cfa_dlink(thread$); 199 200 struct { 201 struct thread$ * next; 202 struct thread$ * prev; 203 } node; 215 204 216 205 // used to store state between clh lock/unlock … … 225 214 226 215 #if defined( __CFA_WITH_VERIFY__ ) 227 struct processor * volatile executing;228 216 void * canary; 229 217 #endif 230 218 }; 231 219 #ifdef __cforall 220 P9_EMBEDDED( thread$, dlink(thread$) ) 221 #endif 232 222 // Wrapper for gdb 233 223 struct cfathread_thread_t { struct thread$ debug; }; … … 241 231 #ifdef __cforall 242 232 extern "Cforall" { 243 static inline thread$ * volatile & ?`next ( thread$ * this ) {244 return this->user_link.next;245 }246 233 247 234 static inline thread$ *& get_next( thread$ & this ) __attribute__((const)) { 248 return this.user_link.next; 249 } 250 251 static inline tytagref( dlink(thread$), dlink(thread$) ) ?`inner( thread$ & this ) { 252 dlink(thread$) & b = this.user_link; 253 tytagref( dlink(thread$), dlink(thread$) ) result = { b }; 254 return result; 255 } 256 257 static inline tytagref(struct __thread_user_link, dlink(thread$)) ?`inner( struct thread$ & this ) { 258 struct __thread_user_link & ib = this.cltr_link; 259 dlink(thread$) & b = ib`inner; 260 tytagref(struct __thread_user_link, dlink(thread$)) result = { b }; 261 return result; 262 } 263 264 P9_EMBEDDED(struct __thread_user_link, dlink(thread$)) 235 return this.link.next; 236 } 237 238 static inline [thread$ *&, thread$ *& ] __get( thread$ & this ) __attribute__((const)) { 239 return this.node.[next, prev]; 240 } 265 241 266 242 static inline void ?{}(__monitor_group_t & this) {
Note:
See TracChangeset
for help on using the changeset viewer.