Icicle\Concurrent\Sync\SharedMemoryParcel::unwrap PHP Method

unwrap() public method

public unwrap ( )
    public function unwrap()
    {
        if ($this->isFreed()) {
            throw new SharedMemoryException('The object has already been freed.');
        }
        $header = $this->getHeader();
        // Make sure the header is in a valid state and format.
        if ($header['state'] !== self::STATE_ALLOCATED || $header['size'] <= 0) {
            throw new SharedMemoryException('Shared object memory is corrupt.');
        }
        // Read the actual value data from memory and unserialize it.
        $data = $this->memGet(self::MEM_DATA_OFFSET, $header['size']);
        return unserialize($data);
    }