| OLD | NEW |
| 1 # Copyright 2009 Google Inc. All Rights Reserved. | 1 # Copyright 2009 Google Inc. All Rights Reserved. |
| 2 # | 2 # |
| 3 # Licensed under the Apache License, Version 2.0 (the "License"); | 3 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 # you may not use this file except in compliance with the License. | 4 # you may not use this file except in compliance with the License. |
| 5 # You may obtain a copy of the License at | 5 # You may obtain a copy of the License at |
| 6 # | 6 # |
| 7 # http://www.apache.org/licenses/LICENSE-2.0 | 7 # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 # | 8 # |
| 9 # Unless required by applicable law or agreed to in writing, software | 9 # Unless required by applicable law or agreed to in writing, software |
| 10 # distributed under the License is distributed on an "AS IS" BASIS, | 10 # distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 running = self.running | 588 running = self.running |
| 589 self.running = [] | 589 self.running = [] |
| 590 for t in running: | 590 for t in running: |
| 591 if t.isAlive(): | 591 if t.isAlive(): |
| 592 self.running.append(t) | 592 self.running.append(t) |
| 593 else: | 593 else: |
| 594 t.join() | 594 t.join() |
| 595 t.kwargs['options'].stdout.full_flush() | 595 t.kwargs['options'].stdout.full_flush() |
| 596 if self.progress: | 596 if self.progress: |
| 597 self.progress.update(1) | 597 self.progress.update(1) |
| 598 assert not t.name in self.ran | 598 assert not t.item.name in self.ran |
| 599 if not t.name in self.ran: | 599 if not t.item.name in self.ran: |
| 600 self.ran.append(t.name) | 600 self.ran.append(t.item.name) |
| 601 | 601 |
| 602 def _run_one_task(self, task_item, args, kwargs): | 602 def _run_one_task(self, task_item, args, kwargs): |
| 603 if self.jobs > 1: | 603 if self.jobs > 1: |
| 604 # Start the thread. | 604 # Start the thread. |
| 605 index = len(self.ran) + len(self.running) + 1 | 605 index = len(self.ran) + len(self.running) + 1 |
| 606 # Copy 'options' and add annotated stdout. | 606 # Copy 'options' and add annotated stdout. |
| 607 task_kwargs = kwargs.copy() | 607 task_kwargs = kwargs.copy() |
| 608 task_kwargs['options'] = copy.copy(task_kwargs['options']) | 608 task_kwargs['options'] = copy.copy(task_kwargs['options']) |
| 609 task_kwargs['options'].stdout = StdoutAnnotated( | 609 task_kwargs['options'].stdout = StdoutAnnotated( |
| 610 '%d>' % index, task_kwargs['options'].stdout) | 610 '%d>' % index, task_kwargs['options'].stdout) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 639 logging.info('Caught exception in thread %s' % self.item.name) | 639 logging.info('Caught exception in thread %s' % self.item.name) |
| 640 logging.info(str(sys.exc_info())) | 640 logging.info(str(sys.exc_info())) |
| 641 work_queue.exceptions.put(sys.exc_info()) | 641 work_queue.exceptions.put(sys.exc_info()) |
| 642 logging.info('Task %s done' % self.item.name) | 642 logging.info('Task %s done' % self.item.name) |
| 643 | 643 |
| 644 work_queue.ready_cond.acquire() | 644 work_queue.ready_cond.acquire() |
| 645 try: | 645 try: |
| 646 work_queue.ready_cond.notifyAll() | 646 work_queue.ready_cond.notifyAll() |
| 647 finally: | 647 finally: |
| 648 work_queue.ready_cond.release() | 648 work_queue.ready_cond.release() |
| OLD | NEW |