© { JSL }
83
Text Box: lock
lock
·C# does not have a synchronize keyword
wit has lock statements
public class Monitor
{
    public static void Enter(object);
    public static void Exit(object);
    ...
}
lock (expression) embedded-statement
System.Threading.Monitor.Enter(expression);
try {
    embedded-statement
}
finally {
   System.Threading.Monitor.Exit(expression);
}
precisely equivalent to (expression is evaluated once)