Busy task no longer runs in a separate thread.
This commit is contained in:
parent
f249896ce1
commit
4394882a7b
|
@ -28,8 +28,7 @@ module Vagrant
|
||||||
begin
|
begin
|
||||||
Signal.trap("INT") { wait_for_not_busy }
|
Signal.trap("INT") { wait_for_not_busy }
|
||||||
Busy.busy = true
|
Busy.busy = true
|
||||||
runner = Thread.new(block) { block.call }
|
block.call
|
||||||
runner.join
|
|
||||||
ensure
|
ensure
|
||||||
# In the case an exception is thrown, make sure we restore
|
# In the case an exception is thrown, make sure we restore
|
||||||
# busy back to some sane state.
|
# busy back to some sane state.
|
||||||
|
|
|
@ -73,15 +73,6 @@ class BusyTest < Test::Unit::TestCase
|
||||||
assert Vagrant.busy?
|
assert Vagrant.busy?
|
||||||
end
|
end
|
||||||
|
|
||||||
should "run the action in a new thread" do
|
|
||||||
runner_thread = nil
|
|
||||||
Vagrant.busy do
|
|
||||||
runner_thread = Thread.current
|
|
||||||
end
|
|
||||||
|
|
||||||
assert_not_equal Thread.current, runner_thread
|
|
||||||
end
|
|
||||||
|
|
||||||
should "trap INT" do
|
should "trap INT" do
|
||||||
trap_seq = sequence("trap_seq")
|
trap_seq = sequence("trap_seq")
|
||||||
Signal.expects(:trap).with("INT", anything).once.in_sequence(trap_seq)
|
Signal.expects(:trap).with("INT", anything).once.in_sequence(trap_seq)
|
||||||
|
|
|
@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
||||||
|
|
||||||
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
||||||
s.authors = ["Mitchell Hashimoto", "John Bender"]
|
s.authors = ["Mitchell Hashimoto", "John Bender"]
|
||||||
s.date = %q{2010-04-23}
|
s.date = %q{2010-04-24}
|
||||||
s.default_executable = %q{vagrant}
|
s.default_executable = %q{vagrant}
|
||||||
s.description = %q{Vagrant is a tool for building and distributing virtualized development environments.}
|
s.description = %q{Vagrant is a tool for building and distributing virtualized development environments.}
|
||||||
s.email = ["mitchell.hashimoto@gmail.com", "john.m.bender@gmail.com"]
|
s.email = ["mitchell.hashimoto@gmail.com", "john.m.bender@gmail.com"]
|
||||||
|
|
Loading…
Reference in New Issue