framework/mutex/Mutex.php
public function acquire($name, $timeout = 0)
    {
        if (!in_array($name, $this->_locks, true) && $this->acquireLock($name, $timeout)) {
            $this->_locks[] = $name;

            return true;
        }

        return false;
    }
public function acquire($name, $timeout = 0)
    {
        if (!in_array($name, $this->_locks, true) && $this->acquireLock($name, $timeout)) {
            $this->_locks[] = $name;

            return true;
        }

        return false;
    }
Acquires a lock by name.
@param string $name of the lock to be acquired. Must be unique.
@param int $timeout time (in seconds) to wait for lock to be released. Defaults to zero meaning that method will return
false immediately in case lock was already acquired.
@return bool lock acquiring result.