Serialized the shutdown procedure.