Methods silence_stream/quietly are not thread-safe [skip ci]

State that on the doc.

[fixes #11954]
上级 5d037819
......@@ -41,6 +41,8 @@ def silence_stderr #:nodoc:
# end
#
# puts 'But this will'
#
# This method is not thread-safe.
def silence_stream(stream)
old_stream = stream.dup
stream.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
......@@ -100,6 +102,8 @@ def capture(stream)
# Silences both STDOUT and STDERR, even for subprocesses.
#
# quietly { system 'bundle install' }
#
# This method is not thread-safe.
def quietly
silence_stream(STDOUT) do
silence_stream(STDERR) do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册