diff options
Diffstat (limited to 'libc/bionic/system_property_api.cpp')
| -rw-r--r-- | libc/bionic/system_property_api.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libc/bionic/system_property_api.cpp b/libc/bionic/system_property_api.cpp index 051bc4c4f..a641f12a8 100644 --- a/libc/bionic/system_property_api.cpp +++ b/libc/bionic/system_property_api.cpp @@ -100,7 +100,13 @@ int __system_property_add(const char* name, unsigned int namelen, const char* va __BIONIC_WEAK_FOR_NATIVE_BRIDGE uint32_t __system_property_serial(const prop_info* pi) { - return system_properties.Serial(pi); + // N.B. a previous version of this function was much heavier-weight + // and enforced acquire semantics, so give our load here acquire + // semantics just in case somebody depends on + // __system_property_serial enforcing memory order, e.g., in case + // someone spins on the result of this function changing before + // loading some value. + return atomic_load_explicit(&pi->serial, memory_order_acquire); } __BIONIC_WEAK_FOR_NATIVE_BRIDGE |
