Skip to content

Commit 81837e7

Browse files
committed
Use guaranteed delta history for changes in current pool size
1 parent 55664f1 commit 81837e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/task/blocking.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ fn create_blocking_thread() {
100100
.spawn(move || {
101101
let wait_limit = Duration::from_millis(1000 + rand_sleep_ms);
102102

103-
CURRENT_POOL_SIZE.fetch_add(1, Ordering::Relaxed);
103+
CURRENT_POOL_SIZE.fetch_add(1, Ordering::SeqCst);
104104
while let Ok(task) = POOL.receiver.recv_timeout(wait_limit) {
105105
abort_on_panic(|| task.run());
106106
calculate_dispatch_frequency();
107107
}
108-
CURRENT_POOL_SIZE.fetch_sub(1, Ordering::Relaxed);
108+
CURRENT_POOL_SIZE.fetch_sub(1, Ordering::SeqCst);
109109
})
110110
.expect("cannot start a dynamic thread driving blocking tasks");
111111
}

0 commit comments

Comments
 (0)