src/vs/workbench/services/textfile/common/textFileEditorModelManager.ts/TextFileEditorModelManager/doJoinPendingResolves
class TextFileEditorModelManager:	private async doJoinPendingResolves(resource: URI): Promise<void> {

		// While we have pending model resolves, ensure
		// to await the last one finishing before returning.
		// This prevents a race when multiple clients await
		// the pending resolve and then all trigger the resolve
		// at the same time.
		let currentModelCopyResolve: Promise<void> | undefined;
		while (this.mapResourceToPendingModelResolvers.has(resource)) {
			const nextPendingModelResolve = this.mapResourceToPendingModelResolvers.get(resource);
			if (nextPendingModelResolve === currentModelCopyResolve) {
				return; // already awaited on - return
			}

			currentModelCopyResolve = nextPendingModelResolve;
			try {
				await nextPendingModelResolve;
			} catch (error) {
				// ignore any error here, it will bubble to the original requestor
			}
		}
	}