Browse Source

Return "wait for all threads" code

It was decided it can be used to inform user when the process really
finishes.

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac335@3269 e5f2f494-b856-4b98-b285-d166d9295462
Michal Vaner 14 years ago
parent
commit
f065ee0f1a
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/bin/xfrout/xfrout.py.in

+ 7 - 0
src/bin/xfrout/xfrout.py.in

@@ -461,6 +461,13 @@ class XfroutServer:
         if self._unix_socket_server:
             self._unix_socket_server.shutdown()
 
+        # Wait for all threads to terminate
+        main_thread = threading.currentThread()
+        for th in threading.enumerate():
+            if th is main_thread:
+                continue
+            th.join()
+
     def command_handler(self, cmd, args):
         if cmd == "shutdown":
             self._log.log_message("info", "Received shutdown command.")