R
Roy Chastain
Question
If control leaves the locked block does the lock get cleared?
Example (simple and bad coding)
lock(obj)
{
// code
return;
}
It appears to me that the lock does NOT get cleared, which seems a little strange given the 'block' oriented nature of lock.
Since it handles exceptions for you, I had assumed that it handled block exits also.
Can someone confirm or deny my suspicions?
Thanks
If control leaves the locked block does the lock get cleared?
Example (simple and bad coding)
lock(obj)
{
// code
return;
}
It appears to me that the lock does NOT get cleared, which seems a little strange given the 'block' oriented nature of lock.
Since it handles exceptions for you, I had assumed that it handled block exits also.
Can someone confirm or deny my suspicions?
Thanks