protected function createIPCSemaphore()
    {
        $this->fileIPC2 = '/tmp/'.mt_rand().md5($this->getName()).'.sem';

        touch($this->fileIPC2);

        $sem_key = ftok($this->fileIPC2, 't');
        if ($sem_key === -1) {
            throw new Exception('Fatal exception creating semaphore (ftok)');
        }

        $this->internalSemaphoreKey = shmop_open($sem_key, 'c', 0644, 10);
        if (!$this->internalSemaphoreKey) {
            return false;
        }

        return true;
    }
protected function createIPCSemaphore()
    {
        $this->fileIPC2 = '/tmp/'.mt_rand().md5($this->getName()).'.sem';

        touch($this->fileIPC2);

        $sem_key = ftok($this->fileIPC2, 't');
        if ($sem_key === -1) {
            throw new Exception('Fatal exception creating semaphore (ftok)');
        }

        $this->internalSemaphoreKey = shmop_open($sem_key, 'c', 0644, 10);
        if (!$this->internalSemaphoreKey) {
            return false;
        }

        return true;
    }
protected function createIPCSemaphore ( ) { $ this -> fileIPC2 = '/tmp/' . mt_rand ( ) . md5 ( $ this -> getName ( ) ) . '.sem' ; touch ( $ this -> fileIPC2 ) ; $ sem_key = ftok ( $ this -> fileIPC2 , 't' ) ; if ( $ sem_key === - 1 ) { throw new Exception ( 'Fatal exception creating semaphore (ftok)' ) ; } $ this -> internalSemaphoreKey = shmop_open ( $ sem_key , 'c' , 0644 , 10 ) ; if ( ! $ this -> internalSemaphoreKey ) { return false ; } return true ; }
Create IPC semaphore

@access protected

@return bool
@throws Exception
Create IPC semaphore