# 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
- [F] —
void
— Wait — ( Wait ) - [F] —
void
— Wait For Condition — ( ) - [F] —
void
— Wait For Condition With Maximum Duration — ( ) - [F] —
void
— Wait For Timer — ( libNtve_gf_WaitForTimer ) - [F] —
void
— Critical Section — ( )
# Examples
— None found —