lock ? $this->lock = false : true); }; while (!$this->lock || $this->synchronized($tsl)) { yield from Coroutine\sleep(self::LATENCY_TIMEOUT); } return new Lock(function () { $this->release(); }); } /** * Releases the lock. */ protected function release() { $this->lock = true; } }