Semaphore kernel