L13: Add semaphore support.