Changes in libcfa/src/concurrency/invoke.h [ae7be7a:d72c074]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/invoke.h
rae7be7a rd72c074 48 48 extern __attribute__((aligned(128))) thread_local struct KernelThreadData { 49 49 struct $thread * volatile this_thread; 50 struct processor * volatile this_processor; 50 struct processor * volatile this_processor; 51 struct __stats_t * volatile this_stats; 51 52 52 53 struct { … … 56 57 } preemption_state; 57 58 58 uint32_t rand_seed;59 __uint128_t rand_seed; 59 60 } kernelTLS __attribute__ ((tls_model ( "initial-exec" ))); 60 61 } … … 92 93 }; 93 94 94 enum coroutine_state { Halted, Start, Primed, Blocked, Ready, Active, Rerun};95 enum __Coroutine_State { Halted, Start, Primed, Blocked, Ready, Active }; 95 96 enum __Preemption_Reason { __NO_PREEMPTION, __ALARM_PREEMPTION, __POLL_PREEMPTION, __MANUAL_PREEMPTION }; 96 97 … … 106 107 107 108 // current execution status for coroutine 108 enum coroutine_state state;109 enum __Coroutine_State state; 109 110 110 111 // first coroutine to resume this one … … 161 162 }; 162 163 164 // Link lists fields 165 // instrusive link field for threads 166 struct __thread_desc_link { 167 struct $thread * next; 168 struct $thread * prev; 169 volatile unsigned long long ts; 170 int preferred; 171 }; 172 163 173 struct $thread { 164 174 // Core threading fields … … 167 177 168 178 // current execution status for coroutine 169 volatile int state; 170 enum __Preemption_Reason preempted; 179 volatile int ticket; 180 enum __Coroutine_State state:8; 181 enum __Preemption_Reason preempted:8; 171 182 172 183 //SKULLDUGGERY errno is not save in the thread data structure because returnToKernel appears to be the only function to require saving and restoring it 184 185 // pointer to the cluster on which the thread is running 186 struct cluster * curr_cluster; 187 188 // Link lists fields 189 // instrusive link field for threads 190 struct __thread_desc_link link; 173 191 174 192 // coroutine body used to store context … … 184 202 struct $monitor * self_mon_p; 185 203 186 // pointer to the cluster on which the thread is running187 struct cluster * curr_cluster;188 189 204 // monitors currently held by this thread 190 205 struct __monitor_group_t monitors; 191 192 // Link lists fields193 // instrusive link field for threads194 struct $thread * next;195 206 196 207 struct { … … 202 213 // previous function to park/unpark the thread 203 214 const char * park_caller; 204 enum coroutine_state park_result; 215 int park_result; 216 enum __Coroutine_State park_state; 205 217 bool park_stale; 206 218 const char * unpark_caller; 207 enum coroutine_state unpark_result; 219 int unpark_result; 220 enum __Coroutine_State unpark_state; 208 221 bool unpark_stale; 209 222 #endif … … 218 231 #ifdef __cforall 219 232 extern "Cforall" { 233 220 234 static inline $thread *& get_next( $thread & this ) __attribute__((const)) { 221 return this. next;235 return this.link.next; 222 236 } 223 237
Note:
See TracChangeset
for help on using the changeset viewer.