13.02.2019, 07:49
This example is similar to using semaphores, it executes only the first instance. But it can still have race condition: if C1 is updated really fast (before script.disable happens) two instances will execute in parallel. Semaphores guarantee locking on OS level.