Merge pull request #1718 from madewokherd/sgenthreadcleanup
authormonojenkins <jo.shields+jenkins@xamarin.com>
Tue, 29 Mar 2016 20:01:05 +0000 (21:01 +0100)
committermonojenkins <jo.shields+jenkins@xamarin.com>
Tue, 29 Mar 2016 20:01:05 +0000 (21:01 +0100)
commitac229973136cd80c6ff5c7fee05a63b24e1bcad3
treeec14be2286e65d938bb9cde0740edd7597893fe4
parent136dd01035b2e954d3da75011c11dd6b6ab429cd
parentd34b34c449c9031a3cd3854a072266a1f769276a
Merge pull request #1718 from madewokherd/sgenthreadcleanup

[sgen] Clean up thread pool on shutdown.

Keeping threads around can cause processes to keep running when they shouldn't, particularly on Windows when the entry point returns.

(The reason this is important for me is that Wine provides _CorExeMain, which is an entry point that does return, unlike normal compiled C programs which appear to call exit() after main() returns. A Windows process doesn't exit until ALL threads have exited, so a thread that never exits means a hung process.)

It doesn't seem like we have other GC-specific cleanup code, so I don't know if this is a good approach. Feedback on that question would be appreciated.
mono/metadata/sgen-mono.c