I don't really like that we return the result from finishShutdown only if we are stopping immediately, and are otherwise just returning an empty list.  But this seems like the easiest way to keep the code paths very uniform, and ensure that we are clearing the queue from inside the finishShutdown function.