本文整理汇总了PHP中shm_remove_var函数的典型用法代码示例。如果您正苦于以下问题:PHP shm_remove_var函数的具体用法?PHP shm_remove_var怎么用?PHP shm_remove_var使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了shm_remove_var函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unlock
/**
* Unlock process
*
* @return Mage_Index_Model_Process
*/
public function unlock()
{
$this->_getSemIdentifier();
shm_remove_var($this->_shmId, $this->getIndexerCodeCrc());
@sem_release($this->_getSemIdentifier());
$this->_isLocked = false;
}
示例2: createUnlock
/**
* (non-PHPdoc)
* @see Lexik\Bundle\MaintenanceBundle\Drivers.AbstractDriver::createUnlock()
*/
protected function createUnlock()
{
if ($this->shmId) {
return shm_remove_var($this->shmId, self::VARIABLE_KEY);
}
return false;
}
示例3: get
/**
* {@inheritdoc}
*/
public function get()
{
if (shm_has_var($this->shared_memory_segment, self::$SEGMENT_VAR_ID)) {
$data = shm_get_var($this->shared_memory_segment, self::$SEGMENT_VAR_ID);
shm_remove_var($this->shared_memory_segment, self::$SEGMENT_VAR_ID);
return $data;
}
}
示例4: del
/**
* Delete shared memory var
*/
public function del()
{
sem_acquire($this->__mutex);
//block until released
@shm_remove_var($this->__shm, $this->__key);
sem_release($this->__mutex);
//release mutex
}
示例5: del
public function del($key)
{
if ($this->has($key)) {
return shm_remove_var($this->shm, $this->shm_key($key));
} else {
return false;
}
}
示例6: remove
public function remove(string $key) : bool
{
if (isset($this->_cache[$key])) {
unset($this->_cache[$key]);
}
$key = crc32($key);
if (shm_has_var($this->_shmid, $key)) {
return shm_remove_var($this->_shmid, $key);
} else {
return false;
}
}
示例7: delete
/**
* @param int $key
*
* @throws \Exception
* @return $this
* @author Yohann Marillet
*/
public function delete($key = 1)
{
$res = false;
if ($this->has($key, true)) {
$value = $this->get($key, true);
$res = shm_remove_var($this->segment, $key);
}
if (!$res) {
throw new \Exception('Cannot delete data in semaphore');
}
return $this;
}
示例8: unlink
public function unlink($key)
{
try {
$shm = shm_attach($this->id, self::SEGMENT_SIZE, HESPER_IPC_PERMS);
} catch (BaseException $e) {
return false;
}
try {
$result = shm_remove_var($shm, $key);
} catch (BaseException $e) {
// non existent key
$result = false;
}
shm_detach($shm);
return $result;
}
示例9: set
/**
* @param string $varName
* @param mixed $value
*/
public function set($varName, $value)
{
$this->loadVars();
$varId = array_search($varName, $this->varNames);
if (false === $varId) {
shm_put_var($this->memory, count($this->varNames) + 2, $value);
$this->varNames[] = $varName;
if ($this->lock->lock()) {
shm_put_var($this->memory, self::SID_VARS, $this->varNames);
$this->lock->unlock();
}
} else {
if ($this->lock->lock()) {
if (is_null($value)) {
shm_remove_var($this->memory, $varId + 2);
unset($this->varNames[$varId]);
shm_put_var($this->memory, self::SID_VARS, $this->varNames);
} else {
shm_put_var($this->memory, $varId + 2, $value);
}
$this->lock->unlock();
}
}
}
示例10: delete
/**
* Delete data from storage
* @param string $k
* @return bool
*/
public function delete($k)
{
$key = $this->__hashcode($k);
return @shm_remove_var($this->db, $key);
}
示例11: destroy
public function destroy()
{
if (shm_has_var($this->shm, 1)) {
shm_remove_var($this->shm, 1);
}
shm_remove($this->shm);
}
示例12: delete
/**
* Deletes a cache entry.
*
* @param string $id cache id
* @return boolean TRUE if the cache entry was successfully deleted, FALSE otherwise.
*/
public function delete($id)
{
return shm_remove_var($this->shmId, $this->forgeKey($id));
}
示例13: __unset
public function __unset($name)
{
$name = $this->intkey($name);
shm_remove_var($this->ipc, $name);
}
示例14: delete
/**
* (non-PHPdoc)
* @see \parallely\TransportInterface::delete()
*/
public function delete($sId)
{
$this->_prepare();
$sId = crc32($sId);
if (empty($this->_rShared) !== true and shm_has_var($this->_rShared, $sId) === true) {
shm_remove_var($this->_rShared, $sId);
}
return $this;
}
示例15: delete
/**
* @param $key
*
* @return bool
*/
public function delete($key)
{
return shm_remove_var(self::$shm_id, $key);
}