Changeset bea6233 in mainline for kernel/generic/src/proc/scheduler.c
- Timestamp:
- 2023-02-26T15:27:13Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7cf5ddb
- Parents:
- deed510
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-26 15:18:02)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-26 15:27:13)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/scheduler.c
rdeed510 rbea6233 187 187 188 188 loop: 189 190 189 if (atomic_load(&CPU->nrdy) == 0) { 191 190 /* … … 197 196 CPU->idle = true; 198 197 irq_spinlock_unlock(&CPU->lock, false); 199 interrupts_enable();200 198 201 199 /* 202 * An interrupt might occur right now and wake up a thread. 203 * In such case, the CPU will continue to go to sleep 204 * even though there is a runnable thread. 200 * Go to sleep with interrupts enabled. 201 * Ideally, this should be atomic, but this is not guaranteed on 202 * all platforms yet, so it is possible we will go sleep when 203 * a thread has just become available. 205 204 */ 206 cpu_sleep(); 207 interrupts_disable(); 205 cpu_interruptible_sleep(); 206 207 /* Interrupts are disabled again. */ 208 208 goto loop; 209 209 }
Note:
See TracChangeset
for help on using the changeset viewer.