• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP shm_remove_var函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中shm_remove_var函数的典型用法代码示例。如果您正苦于以下问题:PHP shm_remove_var函数的具体用法?PHP shm_remove_var怎么用?PHP shm_remove_var使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了shm_remove_var函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:ThomasNegeli,项目名称:Magento-FastIndexer,代码行数:12,代码来源:Semaphore.php


示例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;
 }
开发者ID:ashutosh-srijan,项目名称:findit_akeneo,代码行数:11,代码来源:ShmDriver.php


示例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;
     }
 }
开发者ID:vatson,项目名称:isolated-callback,代码行数:11,代码来源:SharedMemory.php


示例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
 }
开发者ID:nejtr0n,项目名称:shmestage,代码行数:11,代码来源:SharedMemory.php


示例5: del

 public function del($key)
 {
     if ($this->has($key)) {
         return shm_remove_var($this->shm, $this->shm_key($key));
     } else {
         return false;
     }
 }
开发者ID:millken,项目名称:ypf,代码行数:8,代码来源:Shm.php


示例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;
     }
 }
开发者ID:boyxp,项目名称:bluefin-base,代码行数:12,代码来源:shm.php


示例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;
 }
开发者ID:ymarillet,项目名称:sknife,代码行数:19,代码来源:SemaphoreShm.php


示例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;
 }
开发者ID:justthefish,项目名称:hesper,代码行数:16,代码来源:SharedMemorySegmentHandler.php


示例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();
         }
     }
 }
开发者ID:CrakLabs,项目名称:ipc-component,代码行数:28,代码来源:ShmMemory.php


示例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);
 }
开发者ID:liningwang,项目名称:camera-beijing,代码行数:10,代码来源:Sysv.php


示例11: destroy

 public function destroy()
 {
     if (shm_has_var($this->shm, 1)) {
         shm_remove_var($this->shm, 1);
     }
     shm_remove($this->shm);
 }
开发者ID:straiway,项目名称:fmt,代码行数:7,代码来源:csp.php


示例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));
 }
开发者ID:jiangtong1125,项目名称:Zebra-Multi-Process,代码行数:10,代码来源:SHMCache.php


示例13: __unset

 public function __unset($name)
 {
     $name = $this->intkey($name);
     shm_remove_var($this->ipc, $name);
 }
开发者ID:Victopia,项目名称:prefw,代码行数:5,代码来源:SharedMemory.php


示例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;
 }
开发者ID:hpbuniat,项目名称:parallely,代码行数:13,代码来源:Sharedmemory.php


示例15: delete

 /**
  * @param      $key
  *
  * @return bool
  */
 public function delete($key)
 {
     return shm_remove_var(self::$shm_id, $key);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:9,代码来源:class.ilShm.php


示例16: rm

 /**
  * remove variable from memory
  *
  * @param string $name  name of the variable
  *
  * @return bool true on success, false on fail
  * @access public
  */
 function rm($name)
 {
     return shm_remove_var($this->_h, $this->_s2i($name));
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:12,代码来源:Systemv.php


示例17: removeVar

 /**
  * Removes a variable from shared memory.
  *
  * @param string $varName
  */
 public function removeVar($varName)
 {
     $this->_registerVarName($varName);
     $useLocalMutex = !$this->_mutex->isAcquired();
     if ($useLocalMutex) {
         $this->_mutex->acquire();
     }
     $varKey = self::$_registeredVarLookup[$varName];
     if (self::$_useSysV) {
         $res = shm_remove_var($this->_shmResource, $varKey);
     } else {
         $this->_readSharedData();
         unset($this->_shmData[$varKey]);
         $res = $this->_writeSharedData();
     }
     $this->addToVar('_varcount', -1);
     if ($useLocalMutex) {
         $this->_mutex->release();
     }
     if (!$res) {
         throw new SharedMemoryException('Got error when attempting to remove shared variable "' . $varName . '".');
     }
 }
开发者ID:performics,项目名称:ga-cli-api,代码行数:28,代码来源:SharedMemory.class.php


示例18: remove

 /**
  * Removes a variable from the shared memory be specified key.
  *
  * @param string $key The key of variable
  *
  * @return bool True if the variable with key has been removed, otherwise false
  *
  * @see checkHandler
  * @see lock
  */
 public function remove($key)
 {
     $this->checkHandle();
     $this->lock();
     $removed = false;
     if ($this->has($key)) {
         $removed = shm_remove_var($this->handle, $this->getIndex($key));
         if ($removed) {
             $keys = $this->getHashKeys();
             unset($keys[$key]);
             shm_put_var($this->handle, self::SHM_HASHKEYS_INDEX, $keys);
         }
     }
     $this->unlock();
     return $removed;
 }
开发者ID:biplane,项目名称:yandex-direct,代码行数:26,代码来源:SharedMemory.php


示例19: offsetUnset

 /**
  * (PHP 5 &gt;= 5.0.0)<br/>
  * Offset to unset
  * @link http://php.net/manual/en/arrayaccess.offsetunset.php
  *
  * @param mixed $offset <p>
  * The offset to unset.
  * </p>
  *
  * @return void
  */
 public function offsetUnset($offset)
 {
     $task = function () use($offset) {
         $keyMapper = $this->getKeyMap();
         if (array_key_exists($offset, $keyMapper)) {
             shm_remove_var($this->id, $keyMapper[$offset]);
             unset($keyMapper[$offset]);
             shm_put_var($this->id, 0, $keyMapper);
         }
     };
     $this->lockExecute($task);
 }
开发者ID:meckhardt,项目名称:ko-process,代码行数:23,代码来源:SharedMemory.php


示例20: gc

 /**
  * Expire old entries.
  */
 function gc()
 {
     $dict = $this->_get_dict();
     foreach ($dict['keys'] as $k => $v) {
         if ($v['expire'] && $v['expire'] <= time()) {
             shm_remove_var($this->shmid, $v['varkey']);
             unset($dict['keys'][$k]);
         }
     }
     $this->_set_dict($dict);
 }
开发者ID:jvinet,项目名称:pronto,代码行数:14,代码来源:shm.php



注:本文中的shm_remove_var函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP shmop_close函数代码示例发布时间:2022-05-24
下一篇:
PHP shm_remove函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap