src/Fuz/Component/SharedMemory/SharedMemory.php
protected function getObjectSafely($openCallback)
    {
        $elapsed = 0;
        $object = $this->getObject();
        if ($this->lock === false)
        {
            while ($object->isLocked())
            {
                $this->storage->close();
                usleep($object->getInterval());
                $this->storage->{$openCallback}();
                $object = $this->getObject();
                if ($object->getTimeout() > 0)
                {
                    $elapsed += $object->getInterval();
                    if (floor($elapsed / 1000000) >= $object->getTimeout())
                    {
                        throw new \Exception(sprintf("Can't access shared object, it is still locked after %d second(s).",
                           $object->getTimeout()));
                    }
                }
            }
        }
        return $object;
    }
protected function getObjectSafely($openCallback)
    {
        $elapsed = 0;
        $object = $this->getObject();
        if ($this->lock === false)
        {
            while ($object->isLocked())
            {
                $this->storage->close();
                usleep($object->getInterval());
                $this->storage->{$openCallback}();
                $object = $this->getObject();
                if ($object->getTimeout() > 0)
                {
                    $elapsed += $object->getInterval();
                    if (floor($elapsed / 1000000) >= $object->getTimeout())
                    {
                        throw new \Exception(sprintf("Can't access shared object, it is still locked after %d second(s).",
                           $object->getTimeout()));
                    }
                }
            }
        }
        return $object;
    }
protected function getObjectSafely ( $ openCallback ) { $ elapsed = 0 ; $ object = $ this -> getObject ( ) ; if ( $ this -> lock === false ) { while ( $ object -> isLocked ( ) ) { $ this -> storage -> close ( ) ; usleep ( $ object -> getInterval ( ) ) ; $ this -> storage -> { $ openCallback } ( ) ; $ object = $ this -> getObject ( ) ; if ( $ object -> getTimeout ( ) > 0 ) { $ elapsed += $ object -> getInterval ( ) ; if ( floor ( $ elapsed / 1000000 ) >= $ object -> getTimeout ( ) ) { throw new \ Exception ( sprintf ( "Can't access shared object, it is still locked after %d second(s)." , $ object -> getTimeout ( ) ) ) ; } } } } return $ object ; }
Recovers the object if the mutex-style lock is released.

@access protected
@param callable $openCallback
@return StoredEntity
@throws \Exception
Recovers the object if the mutex - style lock is released .