*/ class DumbMutex extends Mutex { use RetryAcquireTrait; public $attemptsCounter = 0; public static $locked = false; /** * {@inheritdoc} */ protected function acquireLock($name, $timeout = 0) { return $this->retryAcquire($timeout, function () { $this->attemptsCounter++; if (!static::$locked) { static::$locked = true; return true; } return false; }); } /** * {@inheritdoc} */ protected function releaseLock($name) { if (static::$locked) { static::$locked = false; return true; } return false; } }