exceptions inside a lock statement !?

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
 
S

Stoitcho Goutsev \(100\) [C# MVP]

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

ORC

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top