[svn] commit: r3166 - /branches/trac335/src/bin/zonemgr/zonemgr.py.in

BIND 10 source code commits bind10-changes at lists.isc.org
Sun Oct 10 14:51:50 UTC 2010


Author: chenzhengzhang
Date: Sun Oct 10 14:51:50 2010
New Revision: 3166

Log:
remove useless threading event

Modified:
    branches/trac335/src/bin/zonemgr/zonemgr.py.in

Modified: branches/trac335/src/bin/zonemgr/zonemgr.py.in
==============================================================================
--- branches/trac335/src/bin/zonemgr/zonemgr.py.in (original)
+++ branches/trac335/src/bin/zonemgr/zonemgr.py.in Sun Oct 10 14:51:50 2010
@@ -103,8 +103,6 @@
     def __init__(self, cc, db_file, slave_socket):
         self._cc = cc
         self._check_sock = slave_socket 
-        self._runnable = False
-        self._is_shut_down = threading.Event()
         self._read_sock, self._write_sock = socket.socketpair()
         self._db_file = db_file
         self._zonemgr_refresh_info = {} 
@@ -337,9 +335,8 @@
         """Keep track of zone timers. The loop can be stopped by calling shutdown() in 
         another thread.
         """
-        self._runnable = True
-        self._is_shut_down.clear()
-        while self._runnable:
+        runnable = True
+        while runnable:
             # Zonemgr has no zone.
             if self._zone_mgr_is_empty():
                 time.sleep(LOWERBOUND_RETRY) # A better time?
@@ -370,18 +367,15 @@
                 continue
             if self._read_sock in rlist: # awaken by shutdown socket 
                 self._read_sock.recv(32)
+                runnable = False
                 continue 
             if self._check_sock in rlist: # awaken by check socket
                 self._check_sock.recv(32)
 
-        self._is_shut_down.set()
-
     def shutdown(self):
         """Stop the run_timer() loop. Block until the loop has finished. This must be
         called when run_timer() is running in another thread, or it will deadlock."""
-        self._runnable = False
         self._write_sock.send(b'shutdown') # make self._read_sock readble
-        self._is_shut_down.wait()
 
 class Zonemgr:
     """Zone manager class."""




More information about the bind10-changes mailing list