internal static bool QueueForShutdown (Action a) { lock (shutdown_actions) { if (is_shutting_down) return false; shutdown_actions.Add (a); } return true; }