using System.Collections.Generic;
using System.Threading.Tasks;
public static void Main()
var semaphore = new Semaphore(1, 1);
var tasks = new List<Task>();
for (var i = 0; i < 10; i++)
var task = Task.Run(async () =>
Console.WriteLine("{0}: {1:o}", localI, DateTimeOffset.UtcNow);
Task.WhenAll(tasks).GetAwaiter().GetResult();