generalized shutdown waiting