Changeset 5663872 in mainline for kernel/generic/src/proc/scheduler.c
- Timestamp:
- 2024-01-14T18:24:05Z (17 months ago)
- Branches:
- master
- Children:
- 23f36a3
- Parents:
- 4760793
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-18 13:37:30)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2024-01-14 18:24:05)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/scheduler.c
r4760793 r5663872 443 443 after_thread_ran(); 444 444 445 int expected; 446 445 447 switch (THREAD->state) { 446 448 case Running: … … 462 464 463 465 case Sleeping: 464 /* 465 * Prefer the thread after it's woken up. 466 */ 467 THREAD->priority = -1; 468 irq_spinlock_unlock(&THREAD->lock, false); 466 expected = SLEEP_INITIAL; 467 468 /* Only set SLEEP_ASLEEP in sleep pad if it's still in initial state */ 469 if (atomic_compare_exchange_strong_explicit(&THREAD->sleep_state, 470 &expected, SLEEP_ASLEEP, 471 memory_order_acq_rel, memory_order_acquire)) { 472 473 /* Prefer the thread after it's woken up. */ 474 THREAD->priority = -1; 475 irq_spinlock_unlock(&THREAD->lock, false); 476 } else { 477 assert(expected == SLEEP_WOKE); 478 /* The thread has already been woken up, requeue immediately. */ 479 irq_spinlock_unlock(&THREAD->lock, false); 480 thread_ready(THREAD); 481 } 482 469 483 break; 470 484
Note:
See TracChangeset
for help on using the changeset viewer.