[svn] commit: r3275 - /trunk/src/bin/zonemgr/zonemgr.py.in

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Oct 19 11:43:34 UTC 2010


Author: vorner
Date: Tue Oct 19 11:43:33 2010
New Revision: 3275

Log:
Fix race condition in test

It caused distcheck to fail sometimes.

There's still a small race condition, but it is hopefully only
theoretical issue.

Reviewed in jabber room.

Modified:
    trunk/src/bin/zonemgr/zonemgr.py.in

Modified: trunk/src/bin/zonemgr/zonemgr.py.in
==============================================================================
--- trunk/src/bin/zonemgr/zonemgr.py.in (original)
+++ trunk/src/bin/zonemgr/zonemgr.py.in Tue Oct 19 11:43:33 2010
@@ -323,7 +323,8 @@
 
         return False
 
-    def _run_timer(self):
+    def _run_timer(self, start_event):
+        start_event.set()
         while self._running:
             # If zonemgr has no zone, set timer timeout to LOWERBOUND_RETRY.
             if self._zone_mgr_is_empty():
@@ -371,12 +372,15 @@
         # Prepare the launch
         self._running = True
         (self._read_sock, self._write_sock) = socket.socketpair()
+        start_event = threading.Event()
 
         # Start the thread
-        self._thread = threading.Thread(target = self._run_timer, args = ())
+        self._thread = threading.Thread(target = self._run_timer,
+            args = (start_event,))
         if daemon:
             self._thread.setDaemon(True)
         self._thread.start()
+        start_event.wait()
 
         # Return the thread to anyone interested
         return self._thread




More information about the bind10-changes mailing list