[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

extras-buildsys/server client_manager.py,1.23,1.24



Author: dcbw

Update of /cvs/fedora/extras-buildsys/server
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15581/server

Modified Files:
	client_manager.py 
Log Message:
2005-06-25  Dan Williams <dcbw redhat com>

    * server/client_manager.py
        - Lock access to build client queries because they could be
            called from different threads




Index: client_manager.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/server/client_manager.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- client_manager.py	24 Jun 2005 17:24:20 -0000	1.23
+++ client_manager.py	25 Jun 2005 22:19:10 -0000	1.24
@@ -336,6 +336,8 @@
 
 class BuildClientManager:
     def __init__(self):
+        self._clients_lock = threading.Lock()
+
         # List of addresses of possible builders
         self.possible_clients = CONFIG.get('builders')
         self.running_clients = []
@@ -360,6 +362,7 @@
             del client
 
     def update_clients(self):
+        self._clients_lock.acquire()
         client_list = []
         for address in self.possible_clients:
             # If the address is already in our running_clients list, skip it
@@ -380,6 +383,7 @@
             else:
                 del client
 
+        self._clients_lock.release()
         return client_list
 
     def list_clients(self):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]