public static object synLock = new object(); static int x = 10; public static void Get1() { try { Monitor.Enter(synLock); { x++; } } catch (Exception exx) { Console.WriteLine(exx.Message); } finally { } }
Monitor.Enter(synLock)
Moniter.Exit()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)