[threadpool-io] Ensure selector thread is running before waiting on it (#4582)
commitc3452996bdd2d03bb98fbe3f85013c329d5b56b1
authorLudovic Henry <ludovic@xamarin.com>
Fri, 24 Mar 2017 19:57:40 +0000 (24 15:57 -0400)
committerGitHub <noreply@github.com>
Fri, 24 Mar 2017 19:57:40 +0000 (24 15:57 -0400)
tree8f4c276ec5db5628c42f32fa4e38e5f7f936ca56
parent65d1d7cdaeb553f392f9f969ca1549bbe3e3a432
[threadpool-io] Ensure selector thread is running before waiting on it (#4582)

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