OSDN Git Service

Help the write_thread to terminate
authorDaigo Moriwaki <daigo@debian.org>
Mon, 10 May 2010 12:25:22 +0000 (21:25 +0900)
committerDaigo Moriwaki <daigo@debian.org>
Mon, 10 May 2010 12:29:46 +0000 (21:29 +0900)
changelog
shogi_server/player.rb

index 56fb436..331a196 100644 (file)
--- a/changelog
+++ b/changelog
@@ -1,3 +1,9 @@
+2010-05-10  Daigo Moriwaki <daigo at debian dot org>
+
+       * [shogi-server]
+         - test/*.rb: Improved performance and stability of tests
+         - shogi_server/player.rb: Help the write_thread to terminate
+
 2010-05-06  Daigo Moriwaki <daigo at debian dot org>
 
        * [mk_rate]
 2010-05-06  Daigo Moriwaki <daigo at debian dot org>
 
        * [mk_rate]
index e156650..fedbba7 100644 (file)
@@ -192,6 +192,7 @@ class Player < BasicPlayer
         log_debug("Terminating %s's write thread..." % [@name])
         if @write_thread && @write_thread.alive?
           write_safe(nil)
         log_debug("Terminating %s's write thread..." % [@name])
         if @write_thread && @write_thread.alive?
           write_safe(nil)
+          Thread.pass # help the write_thread to terminate
         end
         @player_logger.close if @player_logger
         log_debug("done.")
         end
         @player_logger.close if @player_logger
         log_debug("done.")