[io-layer] Fix two race conditions, one on FD handle creation and one on interrupt...
authorRodrigo Kumpera <kumpera@gmail.com>
Wed, 28 Jun 2017 22:48:28 +0000 (15:48 -0700)
committerRodrigo Kumpera <kumpera@gmail.com>
Wed, 28 Jun 2017 22:48:28 +0000 (15:48 -0700)
commit1a8bdd5affba07f4688c7c16224cc4ec2ec73aca
tree7de7fcdc6deb69839b0c843bf6f593d7d5bc0e5e
parent71c58f8fb0ac857440424c229963574ef243ca30
[io-layer] Fix two race conditions, one on FD handle creation and one on interrupt install.

mono_w32handle_new_fd: We must hold scan_mutex while initializing an unallocated handle otherwise
mono_w32handle_foreach might think it's a valid handle.

mono_w32handle_timedwait_signal_handle: We must increment the refcount before installing the interrupt handle
as the other end can be called right after we finish installing and would trigger a failure.
mono/metadata/w32handle.c