File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -100,12 +100,12 @@ fn create_blocking_thread() {
100
100
. spawn ( move || {
101
101
let wait_limit = Duration :: from_millis ( 1000 + rand_sleep_ms) ;
102
102
103
- CURRENT_POOL_SIZE . fetch_add ( 1 , Ordering :: Relaxed ) ;
103
+ CURRENT_POOL_SIZE . fetch_add ( 1 , Ordering :: SeqCst ) ;
104
104
while let Ok ( task) = POOL . receiver . recv_timeout ( wait_limit) {
105
105
abort_on_panic ( || task. run ( ) ) ;
106
106
calculate_dispatch_frequency ( ) ;
107
107
}
108
- CURRENT_POOL_SIZE . fetch_sub ( 1 , Ordering :: Relaxed ) ;
108
+ CURRENT_POOL_SIZE . fetch_sub ( 1 , Ordering :: SeqCst ) ;
109
109
} )
110
110
. expect ( "cannot start a dynamic thread driving blocking tasks" ) ;
111
111
}
@@ -123,7 +123,7 @@ fn schedule(t: async_task::Task<()>) {
123
123
// expected pool size is above the MAX_THREADS (which is a
124
124
// case won't happen)
125
125
let pool_size = EXPECTED_POOL_SIZE . load ( Ordering :: Relaxed ) ;
126
- let current_pool_size = CURRENT_POOL_SIZE . load ( Ordering :: Relaxed ) ;
126
+ let current_pool_size = CURRENT_POOL_SIZE . load ( Ordering :: SeqCst ) ;
127
127
let reward = ( AVR_FREQUENCY . load ( Ordering :: Relaxed ) as f64 / 2.0_f64 ) as u64 ;
128
128
129
129
if pool_size > current_pool_size && pool_size <= MAX_THREADS {
You can’t perform that action at this time.
0 commit comments