core: avoid locking in trap context
This commit is contained in:
parent
cab2926633
commit
0ce636d1a3
|
@ -123,9 +123,12 @@ module Vagrant
|
||||||
data[i].gsub!("\r", "\\r")
|
data[i].gsub!("\r", "\\r")
|
||||||
end
|
end
|
||||||
|
|
||||||
@lock.synchronize do
|
# Avoid locks in a trap context introduced from Ruby 2.0
|
||||||
safe_puts("#{Time.now.utc.to_i},#{target},#{type},#{data.join(",")}")
|
Thread.new do
|
||||||
end
|
@lock.synchronize do
|
||||||
|
safe_puts("#{Time.now.utc.to_i},#{target},#{type},#{data.join(",")}")
|
||||||
|
end
|
||||||
|
end.join
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -331,7 +334,6 @@ module Vagrant
|
||||||
if @ui.is_a?(Vagrant::UI::MachineReadable)
|
if @ui.is_a?(Vagrant::UI::MachineReadable)
|
||||||
return machine(type, message, { :target => target })
|
return machine(type, message, { :target => target })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# Otherwise, make sure to prefix every line properly
|
# Otherwise, make sure to prefix every line properly
|
||||||
lines.map do |line|
|
lines.map do |line|
|
||||||
|
|
Loading…
Reference in New Issue