Strict memory order (#306)

* Make MemoryOrdering more strict

* fmt

* Strict mem order for priority_tasks_gate
This commit is contained in:
rakita
2021-03-10 12:36:23 +01:00
committed by GitHub
parent e2024c4b81
commit eca8fb74ae
14 changed files with 56 additions and 66 deletions

View File

@@ -480,7 +480,7 @@ impl TransactionQueue {
// We want to clear stale transactions from the queue as well.
// (Transactions that are occuping the queue for a long time without being included)
let stale_id = {
let current_id = self.insertion_id.load(atomic::Ordering::Relaxed);
let current_id = self.insertion_id.load(atomic::Ordering::SeqCst);
// wait at least for half of the queue to be replaced
let gap = self.pool.read().options().max_count / 2;
// but never less than 100 transactions