I have a class which uses a read-write lock.
I want to see if I've locked and protected all the methods correctly.
Is there a design pattern for a test to check if the locks are set correctly ?
Edit:
Some clarifications:
It's a C# code derived from a C++/CLI Code which has locks in the C++ level... Not that simple. That's why I'm looking for a design for a test, not for a design for how to lock it.
There are a few things that need to be checks while multithreading:
No Deadlocks (Most obvious)
Correctness (If I update it in 1 thread it will be seen in the other)
Atomic write (If I write in one thread, I will able to read only when the full value is written)
Fairness (Might be more theoretical to prove, should be true if i use Mutex anyway)