Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(327)

Side by Side Diff: third_party/scons/scons-local/SCons/Job.py

Issue 17024: Update to SCons 1.2.0. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 """SCons.Job 1 """SCons.Job
2 2
3 This module defines the Serial and Parallel classes that execute tasks to 3 This module defines the Serial and Parallel classes that execute tasks to
4 complete a build. The Jobs class provides a higher level interface to start, 4 complete a build. The Jobs class provides a higher level interface to start,
5 stop, and wait on jobs. 5 stop, and wait on jobs.
6 6
7 """ 7 """
8 8
9 # 9 #
10 # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundat ion 10 # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundat ion
(...skipping 11 matching lines...) Expand all
22 # 22 #
23 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 23 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
24 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 24 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
25 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 25 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 26 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 27 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 28 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 29 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 # 30 #
31 31
32 __revision__ = "src/engine/SCons/Job.py 3603 2008/10/10 05:46:45 scons" 32 __revision__ = "src/engine/SCons/Job.py 3842 2008/12/20 22:59:52 scons"
33 33
34 import os 34 import os
35 import signal 35 import signal
36 36
37 import SCons.Errors 37 import SCons.Errors
38 38
39 # The default stack size (in kilobytes) of the threads used to execute 39 # The default stack size (in kilobytes) of the threads used to execute
40 # jobs in parallel. 40 # jobs in parallel.
41 # 41 #
42 # We use a stack size of 256 kilobytes. The default on some platforms 42 # We use a stack size of 256 kilobytes. The default on some platforms
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 self.setDaemon(1) 236 self.setDaemon(1)
237 self.requestQueue = requestQueue 237 self.requestQueue = requestQueue
238 self.resultsQueue = resultsQueue 238 self.resultsQueue = resultsQueue
239 self.interrupted = interrupted 239 self.interrupted = interrupted
240 self.start() 240 self.start()
241 241
242 def run(self): 242 def run(self):
243 while 1: 243 while 1:
244 task = self.requestQueue.get() 244 task = self.requestQueue.get()
245 245
246 if not task: 246 if task is None:
247 # The "None" value is used as a sentinel by 247 # The "None" value is used as a sentinel by
248 # ThreadPool.cleanup(). This indicates that there 248 # ThreadPool.cleanup(). This indicates that there
249 # are no more tasks, so we should quit. 249 # are no more tasks, so we should quit.
250 break 250 break
251 251
252 try: 252 try:
253 if self.interrupted(): 253 if self.interrupted():
254 raise SCons.Errors.BuildError( 254 raise SCons.Errors.BuildError(
255 task.targets[0], errstr=interrupt_msg) 255 task.targets[0], errstr=interrupt_msg)
256 task.execute() 256 task.execute()
(...skipping 20 matching lines...) Expand all
277 try: 277 try:
278 prev_size = threading.stack_size(stack_size*1024) 278 prev_size = threading.stack_size(stack_size*1024)
279 except AttributeError, e: 279 except AttributeError, e:
280 # Only print a warning if the stack size has been 280 # Only print a warning if the stack size has been
281 # explicitly set. 281 # explicitly set.
282 if not explicit_stack_size is None: 282 if not explicit_stack_size is None:
283 msg = "Setting stack size is unsupported by this version of Python:\n " + \ 283 msg = "Setting stack size is unsupported by this version of Python:\n " + \
284 e.args[0] 284 e.args[0]
285 SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg) 285 SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg)
286 except ValueError, e: 286 except ValueError, e:
287 msg = "Setting stack size failed:\n " + \ 287 msg = "Setting stack size failed:\n " + str(e)
288 e.message
289 SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg) 288 SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg)
290 289
291 # Create worker threads 290 # Create worker threads
292 self.workers = [] 291 self.workers = []
293 for _ in range(num): 292 for _ in range(num):
294 worker = Worker(self.requestQueue, self.resultsQueue, interrupte d) 293 worker = Worker(self.requestQueue, self.resultsQueue, interrupte d)
295 self.workers.append(worker) 294 self.workers.append(worker)
296 295
297 # Once we drop Python 1.5 we can change the following to: 296 # Once we drop Python 1.5 we can change the following to:
298 #if 'prev_size' in locals(): 297 #if 'prev_size' in locals():
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 # for the build to stop if that's appropriate. 420 # for the build to stop if that's appropriate.
422 task.failed() 421 task.failed()
423 422
424 task.postprocess() 423 task.postprocess()
425 424
426 if self.tp.resultsQueue.empty(): 425 if self.tp.resultsQueue.empty():
427 break 426 break
428 427
429 self.tp.cleanup() 428 self.tp.cleanup()
430 self.taskmaster.cleanup() 429 self.taskmaster.cleanup()
OLDNEW
« no previous file with comments | « third_party/scons/scons-local/SCons/Executor.py ('k') | third_party/scons/scons-local/SCons/Memoize.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698