Implement semaphore extension.