Quantcast
Channel: C# lock object inside instance object - Stack Overflow
Browsing latest articles
Browse All 3 View Live

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 Article



Answer 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 Article

C# 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
Browsing latest articles
Browse All 3 View Live




Latest Images