[threadpool-io] Ensure selector thread is running before waiting on it (#4572)
authorLudovic Henry <ludovic@xamarin.com>
Thu, 23 Mar 2017 14:09:33 +0000 (10:09 -0400)
committerGitHub <noreply@github.com>
Thu, 23 Mar 2017 14:09:33 +0000 (10:09 -0400)
commit41d647d2524c393058c5175ee9487506ae4ed957
treeebbe59f0761c53e4be4cebf1b32342966a5b82a5
parent25a5bedec1a36adb88e35f961c3e778e287d9cd6
[threadpool-io] Ensure selector thread is running before waiting on it (#4572)

This could result in a unecessary wait on shutdown where the selector thread would have exited, and the finalizer thread would try to dispose a Socket, which would try to remove the socket from the IOSelector. This removal operation would wait on the selector thread to acknowledge the removal, but because the selector thread would have alreday exited, we would wait on an event that would never happen.
mono/metadata/threadpool-io.c