summaryrefslogtreecommitdiff
path: root/test/fiber/scheduler.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-09-17 14:45:44 +0200
committerBenoit Daloze <eregontp@gmail.com>2020-09-17 14:59:38 +0200
commit9472d160619861201bad91560c06248fef8362dc (patch)
treea2cf2586ca2c920c6f64f58971128982c8669dda /test/fiber/scheduler.rb
parent738a089b3ac55e5bfb26f9121ee73ffcb8c4a36b (diff)
Call scheduler.block instead of scheduler.kernel_sleep for blocking Queue/SizedQueue operations
* scheduler.unblock was already already called before but with no corresponding scheduler.block * add test that Queue#pop makes the scheduler wait until it gets an element.
Diffstat (limited to 'test/fiber/scheduler.rb')
-rw-r--r--test/fiber/scheduler.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/fiber/scheduler.rb b/test/fiber/scheduler.rb
index 1e7f60cdf0..f7a773ade1 100644
--- a/test/fiber/scheduler.rb
+++ b/test/fiber/scheduler.rb
@@ -93,6 +93,7 @@ class Scheduler
end
ensure
@urgent.each(&:close)
+ @urgent = nil
end
def current_time
@@ -139,7 +140,7 @@ class Scheduler
end
if io = @urgent&.last
- @urgent.last.write_nonblock('.')
+ io.write_nonblock('.')
end
end