Csharp Multithreading version and Latch Java implementation.