diff options
Diffstat (limited to 'src/vm')
-rw-r--r-- | src/vm/ceemain.cpp | 2 | ||||
-rw-r--r-- | src/vm/threads.cpp | 2 | ||||
-rw-r--r-- | src/vm/threadsuspend.cpp | 10 | ||||
-rw-r--r-- | src/vm/threadsuspend.h | 3 |
4 files changed, 15 insertions, 2 deletions
diff --git a/src/vm/ceemain.cpp b/src/vm/ceemain.cpp index c6e67d0e8c..c1899f24fb 100644 --- a/src/vm/ceemain.cpp +++ b/src/vm/ceemain.cpp @@ -1160,7 +1160,7 @@ void EEStartupHelper(COINITIEE fFlags) #endif // PROFILING_SUPPORTED InitializeExceptionHandling(); - + // // Install our global exception filter // diff --git a/src/vm/threads.cpp b/src/vm/threads.cpp index 007d233f14..e90a220c64 100644 --- a/src/vm/threads.cpp +++ b/src/vm/threads.cpp @@ -1691,6 +1691,8 @@ void InitThreadManager() // Randomize OBJREF_HASH to handle hash collision. Thread::OBJREF_HASH = OBJREF_TABSIZE - (DbgGetEXETimeStamp()%10); #endif // _DEBUG + + ThreadSuspend::Initialize(); } diff --git a/src/vm/threadsuspend.cpp b/src/vm/threadsuspend.cpp index be220f334a..cc9080116d 100644 --- a/src/vm/threadsuspend.cpp +++ b/src/vm/threadsuspend.cpp @@ -8370,7 +8370,7 @@ bool Thread::InjectGcSuspension() hThread = GetThreadHandle(); if (hThread != INVALID_HANDLE_VALUE && hThread != SWITCHOUT_HANDLE_VALUE) { - ::PAL_InjectActivation(hThread, HandleGCSuspensionForInterruptedThread); + ::PAL_InjectActivation(hThread); return true; } @@ -8379,6 +8379,14 @@ bool Thread::InjectGcSuspension() #endif // FEATURE_HIJACK && PLATFORM_UNIX +// Initialize thread suspension support +void ThreadSuspend::Initialize() +{ +#if defined(FEATURE_HIJACK) && defined(PLATFORM_UNIX) + ::PAL_SetActivationFunction(HandleGCSuspensionForInterruptedThread); +#endif +} + #ifdef _DEBUG BOOL Debug_IsLockedViaThreadSuspension() { diff --git a/src/vm/threadsuspend.h b/src/vm/threadsuspend.h index 73f2b8b803..df88629ad2 100644 --- a/src/vm/threadsuspend.h +++ b/src/vm/threadsuspend.h @@ -197,6 +197,9 @@ public: static HRESULT SuspendRuntime(ThreadSuspend::SUSPEND_REASON reason); static void ResumeRuntime(BOOL bFinishedGC, BOOL SuspendSucceded); + // Initialize thread suspension support + static void Initialize(); + private: static CLREvent * g_pGCSuspendEvent; |