A
Adam Clauss
Documentation states that a call to Wait releases the lock, and will not
return until the lock is reacquired.
How do exceptions figure into this? Are they considered a form of "return"?
Example:
lock (someObj)
{
try
{
Monitor.Wait(someObj);
}
catch (Exception ex)
{
//What is the state of the lock here?
}
}
Will the lock ALWAYS be re-acquired even for exceptions (such as
ThreadInterruptedException)?
Thanks!
return until the lock is reacquired.
How do exceptions figure into this? Are they considered a form of "return"?
Example:
lock (someObj)
{
try
{
Monitor.Wait(someObj);
}
catch (Exception ex)
{
//What is the state of the lock here?
}
}
Will the lock ALWAYS be re-acquired even for exceptions (such as
ThreadInterruptedException)?
Thanks!