public function lock_key($key, &$auto_unlocker_variable)
{
$r = $this->redis->SetNX($this->lock_key_prefix . $key, 1);
if (!$r) {
return false;
}
$this->redis->Expire($this->lock_key_prefix . $key, $this->key_lock_time);
$auto_unlocker_variable = new KeyAutoUnlocker(array($this, 'unlock_key'));
$auto_unlocker_variable->setKey($key);
return true;
}