One condition variable, multiple mutexes

Viewed 1749

I was watching Operating system course part 2 lecture 2 video 17. In this lecture she mentioned that the data-structure of condition variable contains mutex reference and list of waiting threads.

I want to know if it is possible to use the same condition with different mutexes?

For example: I have 2 wait statements

  1. wait(mutex1, condition_A)
  2. wait(mutex2, condition_A) //condition is the same in both

If the answer to the above question is yes, then will these two statements create two condition variables or one? Note: Lecture mentioned only one mutex reference.

1 Answers
Related