Fix incorrect use of compare_exchange

This commit is contained in:
topjohnwu 2022-05-29 22:19:56 -07:00
parent ee0d58a9b8
commit 4ea8bd0229

View File

@ -28,8 +28,8 @@ static const string *default_cert;
bool need_pkg_refresh() { bool need_pkg_refresh() {
struct stat st{}; struct stat st{};
stat("/data/system/packages.xml", &st); stat("/data/system/packages.xml", &st);
ino_t ino = st.st_ino; ino_t ino = pkg_xml_ino.exchange(st.st_ino);
if (pkg_xml_ino.compare_exchange_strong(ino, st.st_ino)) { if (ino == st.st_ino) {
// Packages have not changed // Packages have not changed
return false; return false;
} else { } else {