public function free()
    {
        if (is_resource($this->queue) && msg_queue_exists($this->key)) {
            if (!msg_remove_queue($this->queue)) {
                throw new SemaphoreException('Failed to free the semaphore.');
            }

            $this->queue = null;
        }
    }
public function free()
    {
        if (is_resource($this->queue) && msg_queue_exists($this->key)) {
            if (!msg_remove_queue($this->queue)) {
                throw new SemaphoreException('Failed to free the semaphore.');
            }

            $this->queue = null;
        }
    }
public function free ( ) { if ( is_resource ( $ this -> queue ) && msg_queue_exists ( $ this -> key ) ) { if ( ! msg_remove_queue ( $ this -> queue ) ) { throw new SemaphoreException ( 'Failed to free the semaphore.' ) ; } $ this -> queue = null ; } }
Removes the semaphore if it still exists.

@throws SemaphoreException If the operation failed.
Removes the semaphore if it still exists .