static async Task Main(string[] args) { ThreadingTest demo = new ThreadingTest(); await demo.Run(); Console.WriteLine("Main terminates"); }
static void Main(string[] args) { ThreadingTest demo = new ThreadingTest(); Console.WriteLine("Before running my foo()"); demo.Run(); Console.WriteLine("After running my foo()"); }
static void Main(string[] args) { ThreadingTest demo = new ThreadingTest(); Console.WriteLine("Before running my foo()"); demo.Run(); // synchronous sleep // System.Threading.Thread.Sleep(6000); Console.WriteLine("After running my foo()"); }