[threads] Destroy suspend MonoOSEvent when detaching (#3923)
authorLudovic Henry <ludovic@xamarin.com>
Wed, 9 Nov 2016 20:59:24 +0000 (15:59 -0500)
committerGitHub <noreply@github.com>
Wed, 9 Nov 2016 20:59:24 +0000 (15:59 -0500)
commit723e5a1b07db0f4d83c01bf41e8e6120ea86b3b5
treebc8d1d8956d860abef30862a9ada9080c838e4f7
parent6860a2180a4e411468e7366a49a29ada406b0166
[threads] Destroy suspend MonoOSEvent when detaching (#3923)

* [threads] Destroy suspend MonoOSEvent when detaching

It could happen that we destroy the managed InternalThread object, before we actually detach the thread (in mono/tests/threadpool-exceptions1.exe for example).

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=46536

* [threads] Close thread handle once done with it
mono/metadata/threads.c