Skip to content

Commit

Permalink
Remove next from scheduler
Browse files Browse the repository at this point in the history
This pattern does not work as expected in Natalie, see
natalie-lang#1337 for the bug report.
  • Loading branch information
herwinw committed Oct 13, 2023
1 parent 64b564f commit 933da9a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/natalie/fiber/shared/scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ def initialize
def run
until @waiting.empty?
fiber, = @waiting.find { |fiber, timeout| fiber.alive? && timeout <= current_time }
next if fiber.nil?

@waiting.delete(fiber)
fiber.resume
unless fiber.nil?
@waiting.delete(fiber)
fiber.resume
end
end
end

Expand Down

0 comments on commit 933da9a

Please sign in to comment.