src/vs/workbench/services/lifecycle/common/lifecycleService.ts/AbstractLifecycleService/when
class AbstractLifecycleService:	async when(phase: LifecyclePhase): Promise<void> {
		if (phase <= this._phase) {
			return;
		}

		let barrier = this.phaseWhen.get(phase);
		if (!barrier) {
			barrier = new Barrier();
			this.phaseWhen.set(phase, barrier);
		}

		await barrier.wait();
	}