Skip to content
This repository was archived by the owner on Mar 15, 2022. It is now read-only.

Commit 5ad3342

Browse files
committed
Re-do 61b5976 without indenting changes.
1 parent a841ed7 commit 5ad3342

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

lib/thread_safe/synchronized_delegator.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
# This class is currently being considered for inclusion into stdlib, via
1717
# https://bugs.ruby-lang.org/issues/8556
1818
class SynchronizedDelegator < SimpleDelegator
19+
def setup
20+
@old_abort = Thread.abort_on_exception
21+
Thread.abort_on_exception = true
22+
end
23+
24+
def teardown
25+
Thread.abort_on_exception = @old_abort
26+
end
1927

2028
def initialize(obj)
2129
__setobj__(obj)

test/test_cache_loops.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Thread.abort_on_exception = true
77

8-
class TestCacheTorture < Test::Unit::TestCase
8+
class TestCacheTorture < Test::Unit::TestCase # this is not run unless RUBY_VERSION =~ /1\.8/ || ENV['TRAVIS'] (see the end of the file)
99
THREAD_COUNT = 40
1010
KEY_COUNT = (((2**13) - 2) * 0.75).to_i # get close to the doubling cliff
1111
LOW_KEY_COUNT = (((2**8 ) - 2) * 0.75).to_i # get close to the doubling cliff
@@ -449,4 +449,4 @@ def assert_count_up(result, cache, options, keys)
449449
assert_equal(sum(cache.values), sum(result))
450450
assert_equal(options[:key_count], cache.size)
451451
end
452-
end
452+
end unless RUBY_VERSION =~ /1\.8/ || ENV['TRAVIS']

0 commit comments

Comments
 (0)