File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,20 +180,8 @@ raw_p executor_run(raw_p arg) {
180180 __atomic_store_n (& executor -> vm , vm , __ATOMIC_RELAXED );
181181
182182 for (;;) {
183- // Adaptive spin-wait: spin briefly before sleeping (reduces wake latency)
184- i64_t spin_rounds = 0 ;
185- while (spin_rounds < 1000 ) {
186- if (__atomic_load_n (& executor -> pool -> tasks_count , __ATOMIC_ACQUIRE ) > 0 )
187- break ;
188- if (__atomic_load_n (& executor -> pool -> state , __ATOMIC_ACQUIRE ) == RUN_STATE_STOPPED )
189- break ;
190- backoff_spin (& spin_rounds );
191- }
192-
193183 mutex_lock (& executor -> pool -> mutex );
194- // Re-check after acquiring lock
195- if (executor -> pool -> tasks_count == 0 && executor -> pool -> state == RUN_STATE_RUNNING )
196- cond_wait (& executor -> pool -> run , & executor -> pool -> mutex );
184+ cond_wait (& executor -> pool -> run , & executor -> pool -> mutex );
197185
198186 if (executor -> pool -> state == RUN_STATE_STOPPED ) {
199187 mutex_unlock (& executor -> pool -> mutex );
You can’t perform that action at this time.
0 commit comments