Advertisement
mjc65

Example 1-38. Generated code from a lock statement

Jun 23rd, 2020
1,397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.17 KB | None | 0 0
  1. object gate = new object();
  2. bool __lockTaken = false;
  3. try
  4. {
  5.     Monitor.Enter(gate, ref __lockTaken);
  6. }
  7. finally
  8. {
  9.     if (__lockTaken)
  10.         Monitor.Exit(gate);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement