public function unlock(): Promise
    {
        return $this->pending = call(function () {
            if ($this->pending) {
                yield $this->pending;
            }

            if (!$this->isLocked()) {
                return;
            }

            if ($this->openCount === 1) {
                yield $this->storage->unlock($this->id);
                $this->status &= ~self::STATUS_LOCKED;
            }

            --$this->openCount;
        });
    }