Script.lock_semaphore¶
- Script.lock_semaphore(semaphore, value)¶
Lock semaphore with a specified value.
This instruction locks the given semaphore with a specified value. It will block the thread until the semaphore is set to the specified value. The semaphore is a global int32 variable and semaphore should be an expression that evaluates to the address of the semaphore variable.
- Parameters:
semaphore (Expr) – The expression that evaluates to the address of the semaphore variable.
value (Expr | int) – The value to lock the semaphore with. This can be an integer or an expression that evaluates to an 32-bit signed integer.
- Return type:
None
Notes
Thread group: Must be executed by a single thread (use
self.single_thread()).