Use store instead of fetch_add for atomics
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 2m48s
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 2m48s
This commit is contained in:
parent
95e47c708c
commit
d4bd0ef1ca
|
@ -19,15 +19,15 @@ pub struct Stats {
|
||||||
|
|
||||||
impl Stats {
|
impl Stats {
|
||||||
pub fn add_connection(&self) {
|
pub fn add_connection(&self) {
|
||||||
self.connections.fetch_add(1, Ordering::Relaxed);
|
self.connections.store(1, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_rx_bytes(&self, n: usize) {
|
pub fn add_rx_bytes(&self, n: usize) {
|
||||||
self.rx.fetch_add(n, Ordering::Relaxed);
|
self.rx.store(n, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_tx_bytes(&self, n: usize) {
|
pub fn add_tx_bytes(&self, n: usize) {
|
||||||
self.tx.fetch_add(n, Ordering::Relaxed);
|
self.tx.store(n, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn connections(&self) -> usize {
|
pub fn connections(&self) -> usize {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user