?
Solved

Does exit or return in middle of synclock release synclock

Posted on 2006-04-01
2
Medium Priority
?
299 Views
Last Modified: 2010-05-18
If I execute an method exit or return in middle of synclock start/end block, will it release the synclock?  Or does the code have to execute the synclock end?
0
Comment
Question by:codequest
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 1000 total points
ID: 16353145
From MSDN:
The SyncLock block guarantees release of the lock, no matter how you exit the block.

So, the answer is: yes, lockobject is released.
0
 
LVL 2

Author Comment

by:codequest
ID: 16355422
Thanks!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question