summaryrefslogtreecommitdiff
path: root/src/vm/finalizerthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vm/finalizerthread.h')
-rw-r--r--src/vm/finalizerthread.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/vm/finalizerthread.h b/src/vm/finalizerthread.h
index f11dd15209..d5063b2166 100644
--- a/src/vm/finalizerthread.h
+++ b/src/vm/finalizerthread.h
@@ -8,16 +8,14 @@
class FinalizerThread
{
- static BOOL fRunFinalizersOnUnload;
static BOOL fQuitFinalizer;
-
+
#if defined(__linux__) && defined(FEATURE_EVENT_TRACE)
static ULONGLONG LastHeapDumpTime;
#endif
static CLREvent *hEventFinalizer;
static CLREvent *hEventFinalizerDone;
- static CLREvent *hEventShutDownToFinalizer;
static CLREvent *hEventFinalizerToShutDown;
// Note: This enum makes it easier to read much of the code that deals with the
@@ -40,8 +38,6 @@ class FinalizerThread
static void WaitForFinalizerEvent (CLREvent *event);
- static BOOL FinalizerThreadWatchDogHelper();
-
#ifdef FEATURE_PROFAPI_ATTACH_DETACH
static void ProcessProfilerAttachIfNecessary(ULONGLONG * pui64TimestampLastCheckedEventMs);
#endif // FEATURE_PROFAPI_ATTACH_DETACH
@@ -64,6 +60,17 @@ public:
static BOOL HaveExtraWorkForFinalizer();
+ static void RaiseShutdownEvents()
+ {
+ WRAPPER_NO_CONTRACT;
+ fQuitFinalizer = TRUE;
+ EnableFinalization();
+
+ // Do not wait for FinalizerThread if the current one is FinalizerThread.
+ if (GetThread() != GetFinalizerThread())
+ hEventFinalizerToShutDown->Wait(INFINITE,FALSE);
+ }
+
static void FinalizerThreadWait(DWORD timeout = INFINITE);
// We wake up a wait for finaliation for two reasons:
@@ -72,11 +79,9 @@ public:
static void SignalFinalizationDone(BOOL fFinalizer);
static VOID FinalizerThreadWorker(void *args);
- static void FinalizeObjectsOnShutdown(LPVOID args);
static DWORD WINAPI FinalizerThreadStart(void *args);
static void FinalizerThreadCreate();
- static BOOL FinalizerThreadWatchDog();
};
#endif // _FINALIZER_THREAD_H_