Skip to content

Commit eb5c8d5

Browse files
committed
Thread pool uses ObjectSpace on MRI only.
1 parent 3cce072 commit eb5c8d5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/concurrent/executor/executor.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ def auto_terminate?
6969
def enable_at_exit_handler!(opts = {})
7070
if opts.fetch(:stop_on_exit, true)
7171
@auto_terminate = true
72-
if RUBY_PLATFORM == 'java'
73-
create_java_at_exit_handler!(self)
72+
if RUBY_PLATFORM == 'ruby'
73+
create_mri_at_exit_handler!(self.object_id)
7474
else
75-
create_ruby_at_exit_handler!(self.object_id)
75+
create_at_exit_handler!(self)
7676
end
7777
end
7878
end
7979

80-
def create_ruby_at_exit_handler!(id)
80+
def create_mri_at_exit_handler!(id)
8181
at_exit do
8282
if Concurrent.auto_terminate_all_executors?
8383
this = ObjectSpace._id2ref(id)
@@ -86,7 +86,7 @@ def create_ruby_at_exit_handler!(id)
8686
end
8787
end
8888

89-
def create_java_at_exit_handler!(this)
89+
def create_at_exit_handler!(this)
9090
at_exit do
9191
this.kill if Concurrent.auto_terminate_all_executors?
9292
end

0 commit comments

Comments
 (0)