mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Re-add checked arithmetic to the packet counter. It may not solve the spike problem, but it should be there anyway.
This commit is contained in:
parent
da16691306
commit
acabdc7ff2
@ -193,8 +193,15 @@ impl ThroughputTracker {
|
||||
|
||||
#[inline(always)]
|
||||
fn add_atomic_tuple(tuple: &(AtomicU64, AtomicU64), n: (u64, u64)) {
|
||||
tuple.0.fetch_add(n.0, std::sync::atomic::Ordering::Relaxed);
|
||||
tuple.1.fetch_add(n.1, std::sync::atomic::Ordering::Relaxed);
|
||||
let mut n0 = tuple.0.load(std::sync::atomic::Ordering::Relaxed);
|
||||
if let Some(n) = n0.checked_add(n.0) {
|
||||
tuple.0.store(n, std::sync::atomic::Ordering::Relaxed);
|
||||
}
|
||||
|
||||
let mut n1 = tuple.1.load(std::sync::atomic::Ordering::Relaxed);
|
||||
if let Some(n) = n1.checked_add(n.1) {
|
||||
tuple.1.store(n, std::sync::atomic::Ordering::Relaxed);
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn update_totals(&self) {
|
||||
|
Loading…
Reference in New Issue
Block a user