I want a thread to wait until any of two Conditions are signaled.
Is it possible?
Suppose the thread is handling incoming packets of data, while it’s possible a user interrupts by changing some states.
One Condition is signaled when a packet has come, and the other is signaled when states have been changed.
I think it’s inappropriate to use one Condition for both events, because that would cause a lot of unnecessary wakeups in other threads which are monitoring the states.
You can add a third condition that is signaled by both incoming packets and user state changes? I don’t think it is possible to wait on multiple conditions.