From: monojenkins Date: Tue, 29 Mar 2016 20:01:05 +0000 (+0100) Subject: Merge pull request #1718 from madewokherd/sgenthreadcleanup X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=commitdiff_plain;h=ac229973136cd80c6ff5c7fee05a63b24e1bcad3 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. --- ac229973136cd80c6ff5c7fee05a63b24e1bcad3 diff --cc mono/metadata/sgen-mono.c index 42f860df05d,262589f2a99..efa0e892ecc --- a/mono/metadata/sgen-mono.c +++ b/mono/metadata/sgen-mono.c @@@ -34,9 -34,9 +34,10 @@@ #include "metadata/runtime.h" #include "metadata/sgen-bridge-internals.h" #include "metadata/gc-internals.h" +#include "metadata/handle.h" #include "utils/mono-memory-model.h" #include "utils/mono-logger-internals.h" + #include "sgen/sgen-thread-pool.h" #ifdef HEAVY_STATISTICS static guint64 stat_wbarrier_set_arrayref = 0;