Well, lock(someObj) will be simpler and will use the new Monitor overloads in .NET 4 when used.
In .NET 4, the following is preferred (emph: lock will do this for you ):
bool lockTaken = false; try { Monitor.Enter(lockObj, ref lockTaken); // do something important } finally { if (lockTaken) Monitor.Exit(lockObj); }
Why see Eric Lippert's blog
But the rest: the second; otherwise, if the Enter call fails ( any method call may fail), then try Exit and the blocked one, which you do not have.
source share