public function obtainLock()
    {
        $tries       = 0;
        $waitClosure = $this->getWaitClosure();
        do {
            if ($this->doLock()->isLocked()) {
                return $this;
            }

            ++$tries;
            $waitClosure();
        } while ($tries < $this->lockTry);

        return $this;
    }
public function obtainLock()
    {
        $tries       = 0;
        $waitClosure = $this->getWaitClosure();
        do {
            if ($this->doLock()->isLocked()) {
                return $this;
            }

            ++$tries;
            $waitClosure();
        } while ($tries < $this->lockTry);

        return $this;
    }
public function obtainLock ( ) { $ tries = 0 ; $ waitClosure = $ this -> getWaitClosure ( ) ; do { if ( $ this -> doLock ( ) -> isLocked ( ) ) { return $ this ; } ++ $ tries ; $ waitClosure ( ) ; } while ( $ tries < $ this -> lockTry ) ; return $ this ; }
obtain a lock with retries

@return $this
obtain a lock with retries