exceptions inside a lock statement !?

  • Thread starter Thread starter ORC
  • Start date Start date
O

ORC

Hi,

Will an exception or a return inside a lock statement block unlock the code
so that other threads will be able to enter the code?

Thanks
Ole
 
Hi ORC,
Yes, lock block is compiled as try-finally block where in the finaly block
unlocking is done.
 
Hi Stoitcho

thanks !

Ole

Stoitcho Goutsev (100) said:
Hi ORC,
Yes, lock block is compiled as try-finally block where in the finaly block
unlocking is done.


--
HTH
Stoitcho Goutsev (100) [C# MVP]

ORC said:
Hi,

Will an exception or a return inside a lock statement block unlock the
code
so that other threads will be able to enter the code?

Thanks
Ole
 
Back
Top