- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
r8bee858 rced5e2a 305 305 RUNNING: while(true) { 306 306 thrd_dst->preempted = __NO_PREEMPTION; 307 thrd_dst->state = Active; 307 308 308 309 // Update global state 309 310 kernelTLS().this_thread = thrd_dst; 310 311 // Update the state after setting this_thread312 // so that the debugger can find all active threads313 // in tls storage314 thrd_dst->state = Active;315 311 316 312 /* paranoid */ verify( ! __preemption_enabled() ); … … 339 335 /* paranoid */ verify( ! __preemption_enabled() ); 340 336 337 // Reset global state 338 kernelTLS().this_thread = 0p; 339 341 340 // We just finished running a thread, there are a few things that could have happened. 342 341 // 1 - Regular case : the thread has blocked and now one has scheduled it yet. … … 347 346 348 347 if(unlikely(thrd_dst->preempted != __NO_PREEMPTION)) { 349 // Reset the this_thread now that we know350 // the state isn't active anymore351 kernelTLS().this_thread = 0p;352 353 348 // The thread was preempted, reschedule it and reset the flag 354 349 schedule_thread$( thrd_dst, UNPARK_LOCAL ); … … 357 352 358 353 if(unlikely(thrd_dst->state == Halting)) { 359 // Reset the this_thread now that we know360 // the state isn't active anymore361 kernelTLS().this_thread = 0p;362 363 354 // The thread has halted, it should never be scheduled/run again 364 355 // finish the thread … … 369 360 /* paranoid */ verify( thrd_dst->state == Active ); 370 361 thrd_dst->state = Blocked; 371 372 // Reset the this_thread now that we know373 // the state isn't active anymore374 kernelTLS().this_thread = 0p;375 362 376 363 // set state of processor coroutine to active and the thread to inactive
Note:
See TracChangeset
for help on using the changeset viewer.