src/vs/workbench/services/lifecycle/electron-sandbox/lifecycleService.ts/NativeLifecycleService/handleBeforeShutdown
class NativeLifecycleService:	private async handleBeforeShutdown(reason: ShutdownReason): Promise<boolean> {
		const logService = this.logService;
		const vetos: (boolean | Promise<boolean>)[] = [];
		const pendingVetos = new Set<string>();

		this._onBeforeShutdown.fire({
			veto(value, id) {
				vetos.push(value);

				// Log any veto instantly
				if (value === true) {
					logService.info(`[lifecycle]: Shutdown was prevented (id: ${id})`);
				}

				// Track promise completion
				else if (value instanceof Promise) {
					pendingVetos.add(id);
					value.then(veto => {
						if (veto === true) {
							logService.info(`[lifecycle]: Shutdown was prevented (id: ${id})`);
						}
					}).finally(() => pendingVetos.delete(id));
				}
			},
			reason
		});

		const longRunningBeforeShutdownWarning = disposableTimeout(() => {
			logService.warn(`[lifecycle] onBeforeShutdown is taking a long time, pending operations: ${Array.from(pendingVetos).join(', ')}`);
		}, NativeLifecycleService.BEFORE_SHUTDOWN_WARNING_DELAY);

		try {
			return await handleVetos(vetos, error => this.onShutdownError(reason, error));
		} finally {
			longRunningBeforeShutdownWarning.dispose();
		}
	}