I have 2 async functions, X and Y. Y is only called by X, using like Task.Run( () => Y(some params) ). X creates a cancellation token source and passes it as a parameter to Y, and either X or Y can cancel it, but when Y cancels it, I want Y to wait for X to finish before doing something else. If there was only going to be one X running at a time, I could have a member variable like Task _xTask, and then Y could do await _xTask. But that isn’t the case, and I don’t know how to pass the Task of X to X as a parameter, or determine it from within X. Instead, I could do something like have a Dictionary<Guid, Task>, create a Guid before I create the X Task, and pass that to X, which would pass it to Y, which would grab X’s Task out of that dictionary and await on it. I’m hoping someone has a better idea.