Loading...
Searching...
No Matches
YSFX::StateGuard Class Reference

Detailed Description

Keeps a script's code from running on two threads at once. Reading or writing its state runs its @serialize section, which shares the script's memory with the @sample code the audio thread runs.

The audio thread never waits: when the state is in use it skips its tick. The other side waits for the tick being computed to end.

Public Member Functions

bool try_enter () noexcept
 On the audio thread.
 
void enter () noexcept
 Anywhere else.
 
void leave () noexcept
 

The documentation for this class was generated from the following file: