Skip to content

Commit

Permalink
[Threading] Change behaviour when provided timeout is 0 for Normal pr…
Browse files Browse the repository at this point in the history
…iority or less threads
  • Loading branch information
Gliniak committed Dec 23, 2024
1 parent a6e3d77 commit 22e5216
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/xenia/kernel/xthread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,12 @@ X_STATUS XThread::Delay(uint32_t processor_mode, uint32_t alertable,
timeout_ms = uint32_t(-timeout_ticks / 10000); // Ticks -> MS
} else {
timeout_ms = 0;
// TODO(Gliniak): Check how it works, but it seems outright wrong.
// However some titles like to change priority then go to sleep with timeout
// 0.
if (priority_ <= xe::threading::ThreadPriority::kNormal) {
timeout_ms = 1;
}
}
timeout_ms = Clock::ScaleGuestDurationMillis(timeout_ms);
if (alertable) {
Expand Down

0 comments on commit 22e5216

Please sign in to comment.