We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5bb3bc commit 21aba17Copy full SHA for 21aba17
src/fiber/execution_context/multi_threaded/scheduler.cr
@@ -142,9 +142,13 @@ module Fiber::ExecutionContext
142
yield @global_queue.grab?(@runnables, divisor: @execution_context.size)
143
144
if @execution_context.lock_evloop? { @event_loop.run(pointerof(list), blocking: false) }
145
- if fiber = enqueue_many(pointerof(list))
+ unless list.empty?
146
+ # must stop spinning before calling enqueue_many that may call
147
+ # wake_scheduler which returns immediately if a thread is
148
+ # spinning... but we're spinning, so that would always fail to
149
+ # wake sleeping schedulers despite having runnable fibers
150
spin_stop
- yield fiber
151
+ yield enqueue_many(pointerof(list))
152
end
153
154
0 commit comments