core: avoid locking in trap context

This commit is contained in:
Mitchell Hashimoto 2015-11-18 16:07:25 -08:00
parent cab2926633
commit 0ce636d1a3
1 changed files with 6 additions and 4 deletions

View File

@ -123,9 +123,12 @@ module Vagrant
data[i].gsub!("\r", "\\r")
end
# Avoid locks in a trap context introduced from Ruby 2.0
Thread.new do
@lock.synchronize do
safe_puts("#{Time.now.utc.to_i},#{target},#{type},#{data.join(",")}")
end
end.join
end
end
@ -332,7 +335,6 @@ module Vagrant
return machine(type, message, { :target => target })
end
# Otherwise, make sure to prefix every line properly
lines.map do |line|
"#{prefix}#{target} #{line}"