Threads: Use a semaphore instead of an Event object.