Answer by Steven for C# lock object inside instance object
The object you lock on is in the same class, but a different instance. In that sense you are not breaking encapsulation, but you should still prefer extracting that code so you can prevent locking on...
View ArticleAnswer by parapura rajkumar for C# lock object inside instance object
This is perfectly fine. It is legal C#. In fact this is the preferred way instead of locking this. Because this can be locked from outside the class whereas objLock being private can only be locked...
View ArticleC# lock object inside instance object
i faced ith situation that force me to lock a lock object that is inside of instance object i want to know is it true or not?for clarify :public class classA{ object objLock = new object(); public void...
View Article
More Pages to Explore .....