From 41593f6b731facd4f314324d586f2de83a8d9cbb Mon Sep 17 00:00:00 2001
From: Guido Trotter <ultrotter@google.com>
Date: Tue, 22 Jun 2010 11:46:05 +0200
Subject: [PATCH] Remove job object condition

We don't need it anymore, since nobody waits on it.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 lib/jqueue.py | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/lib/jqueue.py b/lib/jqueue.py
index f63f5e99c..f50cf72e3 100644
--- a/lib/jqueue.py
+++ b/lib/jqueue.py
@@ -162,7 +162,6 @@ class _QueuedJob(object):
   @ivar start_timestmap: the timestamp for start of execution
   @ivar end_timestamp: the timestamp for end of execution
   @ivar lock_status: In-memory locking information for debugging
-  @ivar change: a Condition variable we use for waiting for job changes
 
   """
   # pylint: disable-msg=W0212
@@ -197,9 +196,6 @@ class _QueuedJob(object):
     # In-memory attributes
     self.lock_status = None
 
-    # Condition to wait for changes
-    self.change = threading.Condition(self.queue._lock)
-
   def __repr__(self):
     status = ["%s.%s" % (self.__class__.__module__, self.__class__.__name__),
               "id=%s" % self.id,
@@ -237,9 +233,6 @@ class _QueuedJob(object):
         obj.log_serial = max(obj.log_serial, log_entry[0])
       obj.ops.append(op)
 
-    # Condition to wait for changes
-    obj.change = threading.Condition(obj.queue._lock)
-
     return obj
 
   def Serialize(self):
@@ -465,8 +458,6 @@ class _OpExecCallbacks(mcpu.OpExecCbBase):
       self._job.log_serial += 1
       self._op.log.append((self._job.log_serial, timestamp, log_type, log_msg))
       self._queue.UpdateJobUnlocked(self._job, replicate=False)
-
-      self._job.change.notifyAll()
     finally:
       self._queue.release()
 
@@ -1297,9 +1288,6 @@ class JobQueue(object):
     logging.debug("Writing job %s to %s", job.id, filename)
     self._UpdateJobQueueFile(filename, data, replicate)
 
-    # Notify waiters about potential changes
-    job.change.notifyAll()
-
   def WaitForJobChanges(self, job_id, fields, prev_job_info, prev_log_serial,
                         timeout):
     """Waits for changes in a job.
-- 
GitLab