OK to call return within a lock?

  • Thread starter Thread starter Earl Teigrob
  • Start date Start date
E

Earl Teigrob

If I set a lock within a function and then call a return within the lock,
will the lock on the object be released immediately?

Thanks

Earl
 
Hi Earl,

Yes, it will because the lock actually uses Monitor class and it calls
Monitor.Exit method in a finally block.
 
Back
Top