[threads] Fix leaking threads: SGen Worker and Finalizer (#5284)
authorArmin Hasitzka <cherusker@users.noreply.github.com>
Thu, 7 Sep 2017 10:23:07 +0000 (12:23 +0200)
committerBernhard Urban <bernhard.urban@xamarin.com>
Thu, 7 Sep 2017 10:23:07 +0000 (12:23 +0200)
commit7db0fb0c886f5157066e26c2e2ae2d39c338cf6b
tree5b3fec503c0d6a9adc4d210d2ce61f5e70f1cd00
parentbcf0ad586011ad240a32090805237795e05418d7
[threads] Fix leaking threads: SGen Worker and Finalizer (#5284)

* Fix leaking threads: SGen Worker and Finalizer
- https://bugzilla.xamarin.com/show_bug.cgi?id=58317
- stop SGen workers before the finalizer stops
- clean up SGen workers with the Finalizer
- remove `mono_thread_join (GUINT_TO_POINTER (gc_thread->tid));` as we detach the Finalizer with `mono_threads_join_threads ()` within `mono_gc_cleanup ()`

* [fixup!] Move counting variable into the loop initialiser and add a `(gpointer)` cast
mono/metadata/gc.c
mono/sgen/sgen-thread-pool.c