Explorar el Código

dns_stats: fix stats_read_and_set issue.

Nick Peng hace 4 meses
padre
commit
64fc9f20fb
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/include/smartdns/dns_stats.h

+ 1 - 1
src/include/smartdns/dns_stats.h

@@ -65,7 +65,7 @@ static inline uint64_t stats_read(const uint64_t *s)
 
 static inline uint64_t stats_read_and_set(uint64_t *s, uint64_t v)
 {
-	return __atomic_test_and_set(s, v);
+	return __atomic_exchange_n(s, v, __ATOMIC_SEQ_CST);
 }
 
 static inline void stats_set(uint64_t *s, uint64_t v)