mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
ae95939784
commit
270c48507d
Notes:
git
2021-11-25 23:56:20 +09:00
1 changed files with 2 additions and 1 deletions
|
@ -65,12 +65,13 @@ if defined?(WIN32OLE_EVENT)
|
||||||
if watch_ivar
|
if watch_ivar
|
||||||
# wait until event is proceeded
|
# wait until event is proceeded
|
||||||
tries = 0
|
tries = 0
|
||||||
|
seconds = EnvUtil.apply_timeout_scale(1)
|
||||||
while tries < 5 && instance_variable_get(watch_ivar) == orig_ivar
|
while tries < 5 && instance_variable_get(watch_ivar) == orig_ivar
|
||||||
seconds = 2 ** tries # sleep at most 31s in total
|
|
||||||
$stderr.puts "test_win32ole_event.rb: retrying and sleeping #{seconds}s until #{watch_ivar} is changed from #{orig_ivar.inspect}..."
|
$stderr.puts "test_win32ole_event.rb: retrying and sleeping #{seconds}s until #{watch_ivar} is changed from #{orig_ivar.inspect}..."
|
||||||
WIN32OLE_EVENT.message_loop
|
WIN32OLE_EVENT.message_loop
|
||||||
sleep(seconds)
|
sleep(seconds)
|
||||||
tries += 1
|
tries += 1
|
||||||
|
seconds *= 2 # sleep at most 31s in total
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue