From 3a7df8c1ff453fdeb5d817d33a3e05daab8cac3e Mon Sep 17 00:00:00 2001 From: tianp Date: Sat, 2 Aug 2025 15:33:09 +0800 Subject: [PATCH] =?UTF-8?q?unlock=E6=8E=A5=E5=8F=A3=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tianp Change-Id: I5701444a0d5840e93de555eccb4e14b2cda278eb --- interfaces/kits/js/src/mod_fs/class_file/ani/file_ani.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/interfaces/kits/js/src/mod_fs/class_file/ani/file_ani.cpp b/interfaces/kits/js/src/mod_fs/class_file/ani/file_ani.cpp index f6353d394..759de3243 100644 --- a/interfaces/kits/js/src/mod_fs/class_file/ani/file_ani.cpp +++ b/interfaces/kits/js/src/mod_fs/class_file/ani/file_ani.cpp @@ -84,12 +84,14 @@ void FileAni::TryLock(ani_env *env, [[maybe_unused]] ani_object object, ani_obje if (!isUndefined) { exc = true; } + auto fsFile = FileWrapper::Unwrap(env, object); if (fsFile == nullptr) { HILOGE("Cannot unwrap fsfile!"); ErrorHandler::Throw(env, UNKNOWN_ERR); return; } + auto ret = fsFile->TryLock(exc); if (!ret.IsSuccess()) { HILOGE("TryLock file failed!"); @@ -107,6 +109,7 @@ void FileAni::UnLock(ani_env *env, [[maybe_unused]] ani_object object) ErrorHandler::Throw(env, UNKNOWN_ERR); return; } + auto ret = fsFile->UnLock(); if (!ret.IsSuccess()) { HILOGE("UnLock file failed!"); -- Gitee