count()) { return null; } return $this->shift(); }; while (!$this->count() || ($id = $this->synchronized($tsl)) === null) { yield new Delayed(self::LATENCY_TIMEOUT); } return new Lock($id, function (Lock $lock): void { $id = $lock->getId(); $this->synchronized(function () use ($id) { $this[] = $id; }); }); }); } }