summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fiber/scheduler.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/fiber/scheduler.rb b/test/fiber/scheduler.rb
index e6a8256232..ac19bba7a2 100644
--- a/test/fiber/scheduler.rb
+++ b/test/fiber/scheduler.rb
@@ -309,6 +309,16 @@ class Scheduler
Addrinfo.getaddrinfo(hostname, nil).map(&:ip_address).uniq
end.value
end
+
+ def blocking_operation_wait(work)
+ thread = Thread.new(&work)
+
+ thread.join
+
+ thread = nil
+ ensure
+ thread&.kill
+ end
end
# This scheduler class implements `io_read` and `io_write` hooks which require