public function unlock () {
        if (!$this->beforeUnlock ()) {
            return false;
        }
        $redis = $this->getConnection ()->getClient ();
        $value = $redis->get ($this->name);
        $decimalPlaces = max (strlen (substr ($value , strpos ($value , "."))) , strlen (substr ($this->_expiresAt , strpos ($this->_expiresAt , ".")))) - 1;
        if (bccomp ($value , $this->_expiresAt , $decimalPlaces) == -1 && bccomp ($value , microtime (true) , $decimalPlaces) == 1) {
            return false;
        }


        $redis->delete ($this->name);
        $this->afterUnlock ();
        return true;
    }
public function unlock () {
        if (!$this->beforeUnlock ()) {
            return false;
        }
        $redis = $this->getConnection ()->getClient ();
        $value = $redis->get ($this->name);
        $decimalPlaces = max (strlen (substr ($value , strpos ($value , "."))) , strlen (substr ($this->_expiresAt , strpos ($this->_expiresAt , ".")))) - 1;
        if (bccomp ($value , $this->_expiresAt , $decimalPlaces) == -1 && bccomp ($value , microtime (true) , $decimalPlaces) == 1) {
            return false;
        }


        $redis->delete ($this->name);
        $this->afterUnlock ();
        return true;
    }
public function unlock ( ) { if ( ! $ this -> beforeUnlock ( ) ) { return false ; } $ redis = $ this -> getConnection ( ) -> getClient ( ) ; $ value = $ redis -> get ( $ this -> name ) ; $ decimalPlaces = max ( strlen ( substr ( $ value , strpos ( $ value , "." ) ) ) , strlen ( substr ( $ this -> _expiresAt , strpos ( $ this -> _expiresAt , "." ) ) ) ) - 1 ; if ( bccomp ( $ value , $ this -> _expiresAt , $ decimalPlaces ) == - 1 && bccomp ( $ value , microtime ( true ) , $ decimalPlaces ) == 1 ) { return false ; } $ redis -> delete ( $ this -> name ) ; $ this -> afterUnlock ( ) ; return true ; }
Attempts to unlock the mutex, returns true if successful, or false if the mutex is in use by another process
@return boolean whether the unlock was successful or not
Attempts to unlock the mutex returns true if successful or false if the mutex is in use by another process