OSDN Git Service

Added a new method, Player#wait_write_thread_finish, to have a writer thread finish...
[shogi-server/shogi-server.git] / shogi-server
index 3511c65..89e6118 100755 (executable)
@@ -431,12 +431,13 @@ def main
         if (player.game)
           player.game.kill(player)
         end
-        player.finish # socket has been closed
+        player.finish
         $league.delete(player)
         log_message(sprintf("user %s logout", player.name))
       ensure
         $mutex.unlock
       end
+      player.wait_write_thread_finish(1000) # milliseconds
     rescue Exception => ex
       log_error("server.start: #{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}")
     end