public function createLock($resource, $ttl = 300.0, $autoRelease = true)
    {
        $lock = new Lock(new Key($resource), $this->store, $ttl, $autoRelease);
        $lock->setLogger($this->logger);

        return $lock;
    }
public function createLock($resource, $ttl = 300.0, $autoRelease = true)
    {
        $lock = new Lock(new Key($resource), $this->store, $ttl, $autoRelease);
        $lock->setLogger($this->logger);

        return $lock;
    }
public function createLock ( $ resource , $ ttl = 300.0 , $ autoRelease = true ) { $ lock = new Lock ( new Key ( $ resource ) , $ this -> store , $ ttl , $ autoRelease ) ; $ lock -> setLogger ( $ this -> logger ) ; return $ lock ; }
Creates a lock for the given resource.

@param string     $resource    The resource to lock
@param float|null $ttl         Maximum expected lock duration in seconds
@param bool       $autoRelease Whether to automatically release the lock or not when the lock instance is destroyed

@return Lock
Creates a lock for the given resource .