Browse Source

remove useless threading event

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac335@3166 e5f2f494-b856-4b98-b285-d166d9295462
Jerry 14 years ago
parent
commit
26595cb419
1 changed files with 3 additions and 9 deletions
  1. 3 9
      src/bin/zonemgr/zonemgr.py.in

+ 3 - 9
src/bin/zonemgr/zonemgr.py.in

@@ -103,8 +103,6 @@ class ZonemgrRefresh:
     def __init__(self, cc, db_file, slave_socket):
     def __init__(self, cc, db_file, slave_socket):
         self._cc = cc
         self._cc = cc
         self._check_sock = slave_socket 
         self._check_sock = slave_socket 
-        self._runnable = False
-        self._is_shut_down = threading.Event()
         self._read_sock, self._write_sock = socket.socketpair()
         self._read_sock, self._write_sock = socket.socketpair()
         self._db_file = db_file
         self._db_file = db_file
         self._zonemgr_refresh_info = {} 
         self._zonemgr_refresh_info = {} 
@@ -337,9 +335,8 @@ class ZonemgrRefresh:
         """Keep track of zone timers. The loop can be stopped by calling shutdown() in 
         """Keep track of zone timers. The loop can be stopped by calling shutdown() in 
         another thread.
         another thread.
         """
         """
-        self._runnable = True
-        self._is_shut_down.clear()
-        while self._runnable:
+        runnable = True
+        while runnable:
             # Zonemgr has no zone.
             # Zonemgr has no zone.
             if self._zone_mgr_is_empty():
             if self._zone_mgr_is_empty():
                 time.sleep(LOWERBOUND_RETRY) # A better time?
                 time.sleep(LOWERBOUND_RETRY) # A better time?
@@ -370,18 +367,15 @@ class ZonemgrRefresh:
                 continue
                 continue
             if self._read_sock in rlist: # awaken by shutdown socket 
             if self._read_sock in rlist: # awaken by shutdown socket 
                 self._read_sock.recv(32)
                 self._read_sock.recv(32)
+                runnable = False
                 continue 
                 continue 
             if self._check_sock in rlist: # awaken by check socket
             if self._check_sock in rlist: # awaken by check socket
                 self._check_sock.recv(32)
                 self._check_sock.recv(32)
 
 
-        self._is_shut_down.set()
-
     def shutdown(self):
     def shutdown(self):
         """Stop the run_timer() loop. Block until the loop has finished. This must be
         """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."""
         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._write_sock.send(b'shutdown') # make self._read_sock readble
-        self._is_shut_down.wait()
 
 
 class Zonemgr:
 class Zonemgr:
     """Zone manager class."""
     """Zone manager class."""