From 4ea8bd0229016c1d82c3505918336d6aa260704d Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 29 May 2022 22:19:56 -0700 Subject: [PATCH] Fix incorrect use of compare_exchange --- native/jni/core/package.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/native/jni/core/package.cpp b/native/jni/core/package.cpp index 1c3d2b8da..adc65e898 100644 --- a/native/jni/core/package.cpp +++ b/native/jni/core/package.cpp @@ -28,8 +28,8 @@ static const string *default_cert; bool need_pkg_refresh() { struct stat st{}; stat("/data/system/packages.xml", &st); - ino_t ino = st.st_ino; - if (pkg_xml_ino.compare_exchange_strong(ino, st.st_ino)) { + ino_t ino = pkg_xml_ino.exchange(st.st_ino); + if (ino == st.st_ino) { // Packages have not changed return false; } else {