7
0
Ответвление 0
bastodon/spec/support/threading_helpers.rb
2024-02-07 14:53:29 +00:00

17 строки
317 Б
Ruby

# frozen_string_literal: true
module ThreadingHelpers
def multi_threaded_execution(thread_count)
wait_for_start = true
threads = Array.new(thread_count) do
Thread.new do
true while wait_for_start
yield
end
end
wait_for_start = false
threads.each(&:join)
end
end