protected function lock() { if (!sem_acquire($this->semaphore)) { throw new LockAcquireException("Failed to acquire the Semaphore."); } }