1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/pstore.rb: Fix don't raise "nested transaction" when thread_safe

is true. Patch by Masaki Matsushita (Glass_saga). [ruby-dev:43337]

* test/test_pstore.rb: Test for above.
  Patch by Masaki Matsushita (Glass_saga) [ruby-dev:43337]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
sorah 2011-03-13 07:14:07 +00:00
parent f085a0b034
commit 6ef956ab90
3 changed files with 20 additions and 0 deletions

View file

@ -1,3 +1,11 @@
Sun Mar 13 16:07:58 2011 Shota Fukumori <sorah@tubusu.net>
* lib/pstore.rb: Fix don't raise "nested transaction" when thread_safe
is true. Patch by Masaki Matsushita (Glass_saga). [ruby-dev:43337]
* test/test_pstore.rb: Test for above.
Patch by Masaki Matsushita (Glass_saga) [ruby-dev:43337]
Sat Mar 12 04:12:41 2011 Tanaka Akira <akr@fsij.org> Sat Mar 12 04:12:41 2011 Tanaka Akira <akr@fsij.org>
* ext/openssl/ossl_ssl_session.c: parenthesize macro arguments. * ext/openssl/ossl_ssl_session.c: parenthesize macro arguments.

View file

@ -341,6 +341,8 @@ class PStore
end end
end end
value value
rescue ThreadError
raise PStore::Error, "nested transaction"
end end
private private

View file

@ -100,4 +100,14 @@ class PStoreTest < Test::Unit::TestCase
File.unlink("pstore.tmp2.#{Process.pid}") rescue nil File.unlink("pstore.tmp2.#{Process.pid}") rescue nil
end end
end end
def test_nested_transaction_raises_error
assert_raise(PStore::Error) do
@pstore.transaction { @pstore.transaction { } }
end
pstore = PStore.new("pstore.tmp2.#{Process.pid}", true)
assert_raise(PStore::Error) do
pstore.transaction { pstore.transaction { } }
end
end
end end