add support for whenAll to waitWithSemaphore