busy = true Task { defer { busy = false } // do async stuff, possibly throwing exceptions and whatnot }