I want to make Opposite Thread in java.
If Thread A
is running, then Thread B
is waiting.
The other way, Thread B
is running, then Thread A
is waiting.
A : ----- ------------------ -----------
B : ------------ --------
I want to write code with wait()
, notify function(not suspend(), resume)
But it is very difficult for me.
Help me