diff options
| author | Dentomologist <dentomologist@gmail.com> | 2025-10-26 18:06:38 -0700 |
|---|---|---|
| committer | Dentomologist <dentomologist@gmail.com> | 2025-10-26 18:06:38 -0700 |
| commit | 70d8bc6fd722c9d2fb13e20cc3de41b97a25a650 (patch) | |
| tree | 583b78197adbae6d0f3119db89d2cee1be2232df /Source/Core | |
| parent | c47db6dba7f9b0625dd18aacbbf234cc0c0a98ba (diff) | |
CPU: Update PauseAndLock comment
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/HW/CPU.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Source/Core/Core/HW/CPU.h b/Source/Core/Core/HW/CPU.h index 4fa0c1105b..887d899710 100644 --- a/Source/Core/Core/HW/CPU.h +++ b/Source/Core/Core/HW/CPU.h @@ -86,15 +86,16 @@ public: // Strictly read-only. A lock is required to change the value. const State* GetStatePtr() const; - // Locks the CPU Thread (waiting for it to become idle). - // While this lock is held, the CPU Thread will not perform any action so it is safe to access - // PowerPC, CoreTiming, etc. without racing the CPU Thread. - // Cannot be used recursively. Must be paired as PauseAndLock(true)/PauseAndLock(false). - // Return value for do_lock == true is whether the state was State::Running or not. - // Return value for do_lock == false is whether the state was changed *to* State::Running or not. - // Cannot be used by System threads as it will deadlock. It is threadsafe otherwise. - // "control_adjacent" causes PauseAndLock to behave like SetStepping by modifying the - // state of the Audio and FIFO subsystems as well. + // Locks the CPU Thread (waiting for it to become idle). While this lock is held, the CPU Thread + // will not perform any action so it is safe to access PowerPC, CoreTiming, etc. without racing + // the CPU Thread. + // + // Cannot be used recursively. Cannot be used by System threads as it will deadlock. It is + // threadsafe otherwise. + // + // Each call to PauseAndLock must be paired with a call to RestoreStateAndUnlock. The return value + // for PauseAndLock is whether the state was State::Running or not and should be passed as the + // argument to RestoreStateAndUnlock. bool PauseAndLock(); void RestoreStateAndUnlock(bool unpause_on_unlock); |
