use a dispatch_semaphore_t instead of dispatch_group_t