Create a gist now

Instantly share code, notes, and snippets.

anonymous /a.cs
Created Dec 13, 2017

What would you like to do?
static void Main(string[] args)
Thing current = new Thing(1);
var first = Task.Run(()=>DoStuffTo(current));
var second = Task.Delay(1000).ContinueWith(t => current = null);
Task.WaitAll(first, second);
static void DoStuffTo(in Thing thing)
Console.WriteLine($"Press enter to process {thing.Id}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment