Fix shutdown data race in listner.cc (#761)
A race exists between the runThreaded and shutdown/dtor as follows: runThreaded - called shutdown - called shutdown - check for shutdownFd.isBound returns false (so no notify) runThreaded - thread executing 'run' starts runThreaded - thread calls shutdownFd.bind shutdown - blocks waiting for run thread runThreaded - continues to run as no notification received This deadlock avoided by ensuring the shutdownFd.bind is called before the thread is created rather than doing it at the start of the thread's execution.
Showing
Please register or sign in to comment