From 8edb3ef2529cc0beb0c034482fdb32fa4c95c606 Mon Sep 17 00:00:00 2001 From: David Mason Date: Tue, 13 Mar 2018 01:24:20 -0700 Subject: [local gc] refactor apis for threading and suspension to avoid redundant calls in to the runtime (#16765) * [Local GC] Refactor calls involving thread modes, suspension, and alloc contexts to always operate on current thread * BOOL -> bool for enable/disable preemptive routines, also remove an unused call to GetThread * avoid one indirection by having GCToEEInterface::EnablePreemptiveGC return a bool indicating whether the mode was changed * Callback on IGCHeap for the runtime to notify the GC when it is trapping threads * use g_fSuspensionPending instead of GCToEEInterface::CatchAtSafePoint for allow_fgc * Remove CatchAtSafePoint * Remove GetThread from WaitLongerNoInstru * code review feedback * code review feedback * change BOOL to bool --- src/gc/gcpriv.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gc/gcpriv.h') diff --git a/src/gc/gcpriv.h b/src/gc/gcpriv.h index 4924e8c109..2c66acef4a 100644 --- a/src/gc/gcpriv.h +++ b/src/gc/gcpriv.h @@ -2797,12 +2797,12 @@ public: PER_HEAP_ISOLATED uint32_t wait_for_gc_done(int32_t timeOut = INFINITE); - // Returns TRUE if the thread used to be in cooperative mode + // Returns TRUE if the current thread used to be in cooperative mode // before calling this function. PER_HEAP_ISOLATED - BOOL enable_preemptive (Thread* current_thread); + bool enable_preemptive (); PER_HEAP_ISOLATED - void disable_preemptive (Thread* current_thread, BOOL restore_cooperative); + void disable_preemptive (bool restore_cooperative); /* ------------------- per heap members --------------------------*/ -- cgit v1.2.3