diff --git a/runtime/mem/gc/gc.h b/runtime/mem/gc/gc.h index b6c375291d81609103e09d3eeb0c249d1264214a..728c06b4e00ab9b80aefc6aa93c7b3a69df3f901 100644 --- a/runtime/mem/gc/gc.h +++ b/runtime/mem/gc/gc.h @@ -263,6 +263,12 @@ public: return phase_; } + inline GCTaskCause GetLastGCCause() const + { + // Atomic with acquire order reason: data race with another threads which can update the variable + return last_cause_.load(std::memory_order_acquire); + } + inline bool IsGCRunning() { // Atomic with seq_cst order reason: data race with gc_running_ with requirement for sequentially consistent