From 649b8884c8954656b24f3003256acf05bd2fddca Mon Sep 17 00:00:00 2001 From: Rtangyu Date: Mon, 24 Jul 2023 19:59:31 +0800 Subject: [PATCH] add SuspendVM and ResumeVM issues:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I79K2R Signed-off-by: Rtangyu --- frameworks/native/runtime/js_runtime.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frameworks/native/runtime/js_runtime.cpp b/frameworks/native/runtime/js_runtime.cpp index a681c532d5..d302bfb873 100644 --- a/frameworks/native/runtime/js_runtime.cpp +++ b/frameworks/native/runtime/js_runtime.cpp @@ -934,7 +934,13 @@ bool JsRuntime::BuildJsStackInfoList(uint32_t tid, std::vector& jsFram auto nativeEngine = GetNativeEnginePointer(); CHECK_POINTER_AND_RETURN(nativeEngine, false); std::vector jsFrameInfo; + auto arkNativeEngine = static_cast(nativeEngine->GetWorkerVm(nativeEngine, tid)); + if (arkNativeEngine == nullptr){ + return false; + } + arkNativeEngine->SuspendVM(); bool ret = nativeEngine->BuildJsStackInfoList(tid, jsFrameInfo); + arkNativeEngine->ResumeVM(); if (!ret) { return ret; }