I have a reasonably simple case of two threads interacting with the same data structure. The threads are hosted in their own responsible classes. Let's say these are class Alfons and class Belzebub:
class Alfons { public Mutex listMutex = new Mutex(); private void ProcessListInfo() { listMutex.WaitOne(); // // ... Process multi-access list stuff ... // listMutex.ReleaseMutex(); } } class Belzebub { private Alfons mCachedAlfonsReference; private void ProcessListInfoDifferently() { mCachedAlfonsReference.listMutex.WaitOne(); // // ... Process multi-access list stuff in a different fashion ... // mCachedAlfonsReference.listMutex.ReleaseMutex(); } } My question is whether referencing a Mutex like this can create a concurrency issue OR whether it is recommended practice to do so. Is there a better way of doing this and should I, for example, cache the mutex reference rather than accessing it through a reference.