I have a program involving three TThread objects (thread1, thread2, thread3) and two TMutex objects (mutex12, mutex23). I would like to make thread1 and thread2 mutually exclusive using mutex1. Also, I would like to make thread2 and thread3 mutually exclusive using mutex23. My implementation is something like:
However, this will not compile. Is there a way to implement a scenario like this?
Does TMutex::Lock() pause the thread it’s in, if the mutex is already locked? If this is the case, I know the answer to my own question, but the documentation in the class index doesn’t specify if this is the case.