I want to write a program where two separate threads run two objects and one thread waits to execute its code till it is signalled by the other.
Now to do this I want to use the Condition
interface.
I am unable to figure out where to declare the lock
and condition
variables in my code such that both classes have access to it.
What I want to ask is, how do threads share the lock
and condition
variables so that it is ensured that they are signalling and waiting on the same condition.