What I want to do
I want to create some threads, say thread A, B, C, and block them until an event occurs. When an event occurs, I want to release only one thread.
For Example:
Before event occurs:
Thread A : blocked
Thread B : blocked
Thread C : blocked
After event occurs:
Thread A : blocked
Thread B : unblocked
THread C : blocked
I read that AutoResetEvent
can do this but I can't specify which thread to be unlocked, and ManualResetEvent
will unblock all the blocked threads.
Is there a way to achieve what I want to do?