Encapsulate the finish semaphore in example code