lock (Multithreading)

The lock (Multithreading) node is used to ensure that one thread does not enter a critical section of code while another thread is in a critical section. If another thread tries to enter locked code, it will wait, block, until the object is released.


Using example

The following example includes a lock statement. If the other threads try to execute this function they will wait until the current thread unlocks this object:

Render time: 0.01 seconds
137,029 unique visits