Horde_Memcache::_lockAdd PHP Method

_lockAdd() protected method

Small wrapper around Memcache[d]#add().
protected _lockAdd ( string $key )
$key string The key to lock.
    protected function _lockAdd($key)
    {
        if ($this->_memcache instanceof Memcached) {
            $this->_memcache->add($this->_key($key . self::LOCK_SUFFIX), 1, self::LOCK_TIMEOUT);
        } else {
            $this->_memcache->add($this->_key($key . self::LOCK_SUFFIX), 1, 0, self::LOCK_TIMEOUT);
        }
    }