no, you cant lock a function either but assuming you locked an object and an
exception occurred, the object would not be unlocked. One good approach to
fighting this problem is to use a finally block and release or unlock
resources.
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @
www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------
"Daniel" <softwareengineer98037 (AT) yahoo (DOT) com> wrote
Quote:
exception inside lock before lock body
lock(foo()){bar();} what will happen if foo() throws an exception? will
there be a lock on the exception? |