# Critical Section
Grammar — Enter critical section using lock
Flags —SubFunctions
|Action
Only one “Critical Section” action set associated with the chosen Lock parameter will ever execute at the same time. Note: The Lock parameter requires a boolean variable. Simply specifying true or false will not work. This is useful for avoiding race conditions when you have parallel processes that can modify the same variables.
# Arguments
bool
— Lock
Returns — void
while (#PARAM(lock)) {
Wait(1.0, c_timeGame);
}
#PARAM(lock) = true;
#SUBFUNCS(actions)
#PARAM(lock) = false;
# Related
Category: General / Waits
- Wait —
void
— Wait - Wait For Condition — macro
- Wait For Condition With Maximum Duration — macro
- Wait For Timer —
void
— libNtve_gf_WaitForTimer - Critical Section — macro
# Examples
— None found —