diff --git a/src/fiber/execution_context/isolated.cr b/src/fiber/execution_context/isolated.cr index fe7698c70ef9..c15b6cafed53 100644 --- a/src/fiber/execution_context/isolated.cr +++ b/src/fiber/execution_context/isolated.cr @@ -191,9 +191,12 @@ module Fiber::ExecutionContext def wait : Nil if @running node = Fiber::PointerLinkedListNode.new(Fiber.current) + @mutex.synchronize do @wait_list.push(pointerof(node)) if @running end + + Fiber.suspend end if exception = @exception