Hi Mathias,

1) I'll add wakeup-detection to differentiate between spurious returns (Epoll bug) and wakeup requests
2) I'll add stop detection as well if we are to terminate the selector from the outside
3) When the system shuts down, there is no guarantees for tasks that are separately scheduled

I just pushed some new code for this PR, please review if you have time!