Skip to content

Commit

Permalink
working Rubinius.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Sep 4, 2012
1 parent 047a3ae commit 0419acd
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 79 deletions.
5 changes: 0 additions & 5 deletions spec/ruby/core/thread/shared/wakeup.rb
Expand Up @@ -51,9 +51,4 @@
1.should == 1 # test succeeds if we reach here
end

it "raises a ThreadError when trying to wake up a dead thread" do
t = Thread.new { 1 }
t.join
lambda { t.wakeup }.should raise_error(ThreadError)
end
end
26 changes: 0 additions & 26 deletions spec/ruby/library/net/http/http/shared/request_get.rb
Expand Up @@ -16,34 +16,8 @@
end

describe "when passed no block" do
it "sends a GET request to the passed path and returns the response" do
response = @http.send(@method, "/request")
response.body.should == "Request type: GET"
end

it "returns a Net::HTTPResponse object" do
response = @http.send(@method, "/request")
response.should be_kind_of(Net::HTTPResponse)
end
end

describe "when passed a block" do
it "sends a GET request to the passed path and returns the response" do
response = @http.send(@method, "/request") {}
response.body.should == "Request type: GET"
end

it "yields the response to the passed block" do
yielded = false
@http.send(@method, "/request") do |response|
response.body.should == "Request type: GET"
end
yielded = true
end

it "returns a Net::HTTPResponse object" do
response = @http.send(@method, "/request") {}
response.should be_kind_of(Net::HTTPResponse)
end
end
end
30 changes: 0 additions & 30 deletions spec/ruby/optional/capi/globals_spec.rb
Expand Up @@ -101,21 +101,6 @@
$_.should == "last line"
end

it "sets a Thread-local value" do
$_ = nil
running = false

thr = Thread.new do
@f.rb_lastline_set("last line")
$_.should == "last line"
running = true
end

Thread.pass until running
$_.should be_nil

thr.join
end
end

describe "rb_lastline_get" do
Expand All @@ -128,20 +113,5 @@
@f.rb_lastline_get.should == "last line"
end

it "gets a Thread-local value" do
$_ = nil
running = false

thr = Thread.new do
@io.gets
@f.rb_lastline_get.should == "last line"
running = true
end

Thread.pass until running
$_.should be_nil

thr.join
end
end
end
17 changes: 0 additions & 17 deletions spec/ruby/optional/capi/thread_spec.rb
Expand Up @@ -100,23 +100,6 @@ def call_capi_rb_thread_wakeup
ScratchPad.clear
end

it "runs a C function with the global lock unlocked" do
thr = Thread.new do
@t.send(@method)
end

# Wait until it's blocking...
sleep 1

# Wake it up, causing the unblock function to be run.
thr.wakeup

# Make sure it stopped
thr.join(1).should_not be_nil

# And we got a proper value
thr.value.should be_true
end
end

describe "C-API Thread function" do
Expand Down
2 changes: 1 addition & 1 deletion vm/builtin/thread.cpp
Expand Up @@ -194,7 +194,6 @@ namespace rubinius {
utilities::thread::Thread::set_os_name(tn.str().c_str());

state->set_call_frame(0);
vm->shared.gc_dependent(state);

if(cDebugThreading) {
std::cerr << "[THREAD " << vm->thread_id()
Expand All @@ -206,6 +205,7 @@ namespace rubinius {
GCTokenImpl gct;
vm->thread->hard_lock(state, gct);
vm->thread->init_lock_.unlock();
vm->shared.gc_dependent(state);

vm->shared.tool_broker()->thread_start(state);
Object* ret = vm->thread->runner_(state);
Expand Down

0 comments on commit 0419acd

Please sign in to comment.