mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 18:55:32 +00:00
udp: avoid Ordering::SeqCst for atomic operations
This commit is contained in:
parent
2c336793b1
commit
a1243c59d6
3 changed files with 15 additions and 13 deletions
|
|
@ -132,8 +132,10 @@ pub fn run_request_worker(
|
|||
let peers_ipv4 = torrents.ipv4.values().map(|t| t.peers.len()).sum();
|
||||
let peers_ipv6 = torrents.ipv6.values().map(|t| t.peers.len()).sum();
|
||||
|
||||
state.statistics.peers_ipv4[worker_index.0].store(peers_ipv4, Ordering::SeqCst);
|
||||
state.statistics.peers_ipv6[worker_index.0].store(peers_ipv6, Ordering::SeqCst);
|
||||
state.statistics.peers_ipv4[worker_index.0]
|
||||
.store(peers_ipv4, Ordering::Release);
|
||||
state.statistics.peers_ipv6[worker_index.0]
|
||||
.store(peers_ipv6, Ordering::Release);
|
||||
}
|
||||
|
||||
last_cleaning = now;
|
||||
|
|
@ -142,9 +144,9 @@ pub fn run_request_worker(
|
|||
&& now > last_statistics_update + statistics_update_interval
|
||||
{
|
||||
state.statistics.torrents_ipv4[worker_index.0]
|
||||
.store(torrents.ipv4.len(), Ordering::SeqCst);
|
||||
.store(torrents.ipv4.len(), Ordering::Release);
|
||||
state.statistics.torrents_ipv6[worker_index.0]
|
||||
.store(torrents.ipv6.len(), Ordering::SeqCst);
|
||||
.store(torrents.ipv6.len(), Ordering::Release);
|
||||
|
||||
last_statistics_update = now;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue