I have an object that is not safe for multithreaded applications (in several ways), and I want to provide an internal check to make sure that critical methods are not accessed concurrently.
Question
What techniques should I employ to detect and prevent multiple threads from accessing my class?
Is it sufficient to track the Thread.ID on all methods, properties, etc. that the consumer may use?
Will it help?
or if you have your object accessed externally, you could use Mutex object.