Ejemplo n.º 1
0
 function delete()
 {
     if ($this->shm) {
         sem_acquire($this->sem());
         try {
             $this->shm->delete();
             sem_release($this->sem());
         } catch (Exception $e) {
             sem_release($this->sem());
         }
     }
     $this->logger->debug(sprintf("Delete semaphore (key: 0x%08x)", $this->semKey));
     sem_remove($this->sem());
     if (isset($e)) {
         throw $e;
     }
 }
Ejemplo n.º 2
0
 function endForking()
 {
     try {
         $this->processPool->workQueue->delete();
     } catch (Exception $ignore) {
     }
     if ($this->worker) {
         try {
             $this->worker->endForking();
         } catch (Exception $workerEx) {
         }
     }
     try {
         $this->shm->delete();
     } catch (Exception $ignore) {
     }
     if (isset($workerEx)) {
         throw $workerEx;
     }
 }
Ejemplo n.º 3
0
 function delete()
 {
     $this->logger->debug(sprintf("Delete shm set (key:  0x%08x)", $this->shm->key));
     if (!sem_acquire($this->sem)) {
         throw new Scalr_System_Ipc_Exception("Cannot acquire semaphore");
     }
     try {
         $this->shm->delete();
         unset($this->shm);
     } catch (Exception $ignore) {
     }
     sem_release($this->sem);
     sem_remove($this->sem);
 }
Ejemplo n.º 4
0
 function _cleanup()
 {
     if (!$this->cleanupComplete && posix_getpid() == $this->poolPid) {
         try {
             $this->shm->delete();
         } catch (Exception $ignore) {
         }
         if ($this->childEventQueue) {
             try {
                 $this->childEventQueue->delete();
             } catch (Exception $ignore) {
             }
         }
         if ($this->workersStat) {
             try {
                 $this->workersStat->delete();
             } catch (Exception $ignore) {
             }
         }
         $this->cleanupComplete = true;
     }
 }