Skip to content

Commit c66fd9f

Browse files
AlexanderZagaynovpitr-ch
authored andcommitted
check for method presence instead of version
1 parent e574915 commit c66fd9f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/concurrent/executor/ruby_thread_pool_executor.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ def initialize(pool, id: nil)
300300
@queue = Queue.new
301301
@pool = pool
302302
@thread = create_worker @queue, pool, pool.idletime
303-
if Concurrent.on_cruby? && Concurrent.ruby_version(:>=, 2, 3, 0)
303+
304+
if @thread.respond_to?(:name=)
304305
@thread.name = [pool.name, 'worker', id].compact.join('-')
305306
end
306307
end

0 commit comments

Comments
 (0)