CPU: Update PauseAndLock comment

This commit is contained in:
Dentomologist 2025-10-26 18:06:38 -07:00
parent c47db6dba7
commit 70d8bc6fd7

View File

@ -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);