Lock keyword
Yes Robert, but, just to be exact, it performs a copy of the reference first:Code Snippet// local variable invisible in the case of 'lock', here// it should not be used in the try block.object...
View ArticleLock keyword
The lock statement construct is just a shortcut for:Code SnippetSystem.Threading.Monitor.Enter(lockObject);try{ code stuff...}finally{ System.Threading.Monitor.Exit(lockObject);} Knowing that, you...
View ArticleLock keyword
Thanks for your answer, could i ask you to get me a reference on your answer?
View ArticleLock keyword
Yes, it will be unlocked.Same if you return inside a using (the object will be disposed).
View ArticleLock keyword
If you use return keyword in a lock block, will the locked object unlock? lock(this){// code if(condition) return; // code}
View Article
More Pages to Explore .....