[前][次][番号順一覧][スレッド一覧]

ruby-changes:37229

From: nobu <ko1@a...>
Date: Sun, 18 Jan 2015 00:35:34 +0900 (JST)
Subject: [ruby-changes:37229] nobu:r49310 (trunk): drb.rb: stop all handlers to fix thread leaks

nobu	2015-01-18 00:35:09 +0900 (Sun, 18 Jan 2015)

  New Revision: 49310

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49310

  Log:
    drb.rb: stop all handlers to fix thread leaks
    
    * lib/drb/drb.rb (stop_service): stop all handler threads started
      in main_loop.  fix thread leaks.

  Modified files:
    trunk/lib/drb/drb.rb
Index: lib/drb/drb.rb
===================================================================
--- lib/drb/drb.rb	(revision 49309)
+++ lib/drb/drb.rb	(revision 49310)
@@ -1467,12 +1467,13 @@ module DRb https://github.com/ruby/ruby/blob/trunk/lib/drb/drb.rb#L1467
       if  Thread.current['DRb'] && Thread.current['DRb']['server'] == self
         Thread.current['DRb']['stop_service'] = true
       else
+        threads = [@thread, *@grp.list]
         if @protocol.respond_to? :shutdown
           @protocol.shutdown
         else
-          @thread.kill # xxx: Thread#kill
+          threads.each {|thread| thread.kill} # xxx: Thread#kill
         end
-        @thread.join
+        threads.each {|thread| thread.join}
       end
     end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]