# Critical Section

Grammar — Enter critical section using lock
FlagsSubFunctions | 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;

Category: General / Waits

# Examples

— None found —