Using a long timeout for polling is good to reduce CPU usage and wakeups. But then sending messages is delayed until poll returns since they must be done from same thread. So added function interrupt() that can cancel poll from another thread, then you can check for outgoing messages and send them (or shutdown your program without having to wait for poll)
Using a long timeout for polling is good to reduce CPU usage and wakeups. But then sending messages is delayed until poll returns since they must be done from same thread. So added function interrupt() that can cancel poll from another thread, then you can check for outgoing messages and send them (or shutdown your program without having to wait for poll)