fix threading bug.
* spec/ruby/core/thread/element_set_spec.rb: `t` can be uninitialized. Use `Thread.current` explicitly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
098c8d5491
commit
b895c402a5
@ -9,9 +9,10 @@ describe "Thread#[]=" do
|
|||||||
it "raises a RuntimeError if the thread is frozen" do
|
it "raises a RuntimeError if the thread is frozen" do
|
||||||
running = false
|
running = false
|
||||||
t = Thread.new do
|
t = Thread.new do
|
||||||
t.freeze
|
th = Thread.current
|
||||||
|
th.freeze
|
||||||
-> {
|
-> {
|
||||||
t[:foo] = "bar"
|
th[:foo] = "bar"
|
||||||
}.should raise_error(RuntimeError, /frozen/)
|
}.should raise_error(RuntimeError, /frozen/)
|
||||||
end
|
end
|
||||||
t.join
|
t.join
|
||||||
|
Loading…
x
Reference in New Issue
Block a user