Skip to content

Commit 5454f2e

Browse files
crysbotysbaddaden
andauthored
Fix Fiber::ExecutionContext::Isolated#wait must suspend fiber (#15720) (#15723)
Co-authored-by: Julien Portalier <[email protected]>
1 parent 1816faf commit 5454f2e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/fiber/execution_context/isolated.cr

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,12 @@ module Fiber::ExecutionContext
191191
def wait : Nil
192192
if @running
193193
node = Fiber::PointerLinkedListNode.new(Fiber.current)
194+
194195
@mutex.synchronize do
195196
@wait_list.push(pointerof(node)) if @running
196197
end
198+
199+
Fiber.suspend
197200
end
198201

199202
if exception = @exception

0 commit comments

Comments
 (0)