i have a question .. is it ok if i have something like this :
try
{
lock(programLock)
{
//some stuff 1
}
}
catch(Exception ex) { //stuff 2 }
i am curious if "some stuff 1"
causes an exception , does programLock
still remains locked ?
Locking a question or an answer means the question, or the answer can no longer receive comments.
It has to be 4. That means the final lock combination is 042—that's right, “the answer to the ultimate question of life, the universe, and everything,” as Douglas Adams imagined it.
3 digit numeric lock code is a form of puzzle game that is being sent on WhatsApp groups among friends and families. Read on to know the answer to the puzzle. The Coronavirus pandemic has made people stay indoors as the nation is under lockdown.
No, the lock will be released, lock is roughly equivalent to this:
try
{
Monitor.Enter(programLock);
// some stuff 1
}
finally
{
Monitor.Exit(programLock);
}
(Meaning if an exception is thrown, Monitor.Exit
will get called automatically as you exit the scope of the lock statement)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With