Add condition variable logic to wait on pending responses