From 55c7454e00daf28092f1607c41b8f7f31dd0d7f0 Mon Sep 17 00:00:00 2001 From: wangbowen36 Date: Tue, 12 Aug 2025 19:58:35 +0800 Subject: [PATCH] Revert "Fix codestyle" This reverts commit 99b86db5edf80f3bf2768597685a3050fed850ef. Issue: https://gitee.com/openharmony/arkui_napi/issues/ICSMR9 Signed-off-by: wangbowen36 --- native_engine/native_safe_async_work.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/native_engine/native_safe_async_work.cpp b/native_engine/native_safe_async_work.cpp index 31e1838f4..36a63cd65 100644 --- a/native_engine/native_safe_async_work.cpp +++ b/native_engine/native_safe_async_work.cpp @@ -419,7 +419,8 @@ void NativeSafeAsyncWork::CleanUp() bool NativeSafeAsyncWork::IsSameTid() { - return pthread_self() == engine_->GetTid(); + auto tid = pthread_self(); + return (tid == engine_->GetTid()) ? true : false; } napi_status NativeSafeAsyncWork::PostTask(void *data, int32_t priority, bool isTail) @@ -434,11 +435,11 @@ napi_status NativeSafeAsyncWork::PostTask(void *data, int32_t priority, bool isT // the task will be execute at main thread or worker thread auto task = [this, data]() { HILOG_DEBUG("The task is executing in main thread or worker thread"); - panda::LocalScope scope(engine_->GetEcmaVm()); - napi_value func_ = (ref_ == nullptr) ? nullptr : ref_->Get(engine_); + panda::LocalScope scope(this->engine_->GetEcmaVm()); + napi_value func_ = (this->ref_ == nullptr) ? nullptr : this->ref_->Get(engine_); bool isValidTraceId = SaveAndSetTraceId(); - if (callJsCallback_ != nullptr) { - callJsCallback_(engine_, func_, context_, data); + if (this->callJsCallback_ != nullptr) { + this->callJsCallback_(engine_, func_, context_, data); } else { CallJs(engine_, func_, context_, data); } -- Gitee