protected function cleanThreadContext()
    {
        shmop_delete($this->internalIPCKey);
        shmop_delete($this->internalSemaphoreKey);

        shmop_close($this->internalIPCKey);
        shmop_close($this->internalSemaphoreKey);

        unlink($this->fileIPC1);
        unlink($this->fileIPC2);

        $this->running = false;
        unset($this->pid);
    }