Skip to content

Commit 82fb6f6

Browse files
committed
Fix condition and fix test to catch that broken condition
1 parent daab9a2 commit 82fb6f6

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/timeout.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def initialize
7272
end
7373

7474
if defined?(Ractor.store_if_absent) &&
75-
defined?(Ractor.shareble?) && Ractor.shareable?(GET_TIME)
75+
defined?(Ractor.shareable?) && Ractor.shareable?(GET_TIME)
7676

7777
# Ractor support if
7878
# 1. Ractor.store_if_absent is available
@@ -85,8 +85,6 @@ def initialize
8585
def self.instance
8686
Ractor[:timeout_gem_state]
8787
end
88-
89-
::Timeout::RACTOR_SUPPORT = true # for test
9088
else
9189
GLOBAL_STATE = State.new
9290

test/test_timeout.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,5 +299,5 @@ def test_ractor
299299
300300
assert_equal :ok, r
301301
end;
302-
end if Timeout.const_defined?(:RACTOR_SUPPORT)
302+
end if defined?(::Ractor) && RUBY_VERSION >= '4.0'
303303
end

0 commit comments

Comments
 (0)