Changeset 17c6edeb for libcfa/src/concurrency/kernel.cfa
- Timestamp:
- Aug 16, 2022, 2:52:24 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 71cf630
- Parents:
- 32d1383 (diff), e116db3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
r32d1383 r17c6edeb 305 305 RUNNING: while(true) { 306 306 thrd_dst->preempted = __NO_PREEMPTION; 307 thrd_dst->state = Active;308 307 309 308 // Update global state 310 309 kernelTLS().this_thread = thrd_dst; 310 311 // Update the state after setting this_thread 312 // so that the debugger can find all active threads 313 // in tls storage 314 thrd_dst->state = Active; 311 315 312 316 /* paranoid */ verify( ! __preemption_enabled() ); … … 335 339 /* paranoid */ verify( ! __preemption_enabled() ); 336 340 337 // Reset global state338 kernelTLS().this_thread = 0p;339 340 341 // We just finished running a thread, there are a few things that could have happened. 341 342 // 1 - Regular case : the thread has blocked and now one has scheduled it yet. … … 346 347 347 348 if(unlikely(thrd_dst->preempted != __NO_PREEMPTION)) { 349 // Reset the this_thread now that we know 350 // the state isn't active anymore 351 kernelTLS().this_thread = 0p; 352 348 353 // The thread was preempted, reschedule it and reset the flag 349 354 schedule_thread$( thrd_dst, UNPARK_LOCAL ); … … 352 357 353 358 if(unlikely(thrd_dst->state == Halting)) { 359 // Reset the this_thread now that we know 360 // the state isn't active anymore 361 kernelTLS().this_thread = 0p; 362 354 363 // The thread has halted, it should never be scheduled/run again 355 364 // finish the thread … … 360 369 /* paranoid */ verify( thrd_dst->state == Active ); 361 370 thrd_dst->state = Blocked; 371 372 // Reset the this_thread now that we know 373 // the state isn't active anymore 374 kernelTLS().this_thread = 0p; 362 375 363 376 // set state of processor coroutine to active and the thread to inactive
Note: See TracChangeset
for help on using the changeset viewer.