All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] runqueue: Sanity check BB_NUMBER_THREADS
@ 2015-06-19 11:27 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2015-06-19 11:27 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Tomas Frydrych

Bitbake does really weird things with negative or zero numbers of threads
which is confusing to the user. Add a sanity check for this.

When you have code doing arithmetic on the values and a VM reconfigures
to only a single thread, negative numbers are easier than you'd think.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index a5ae42b..3f62453 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1333,6 +1333,9 @@ class RunQueueExecute:
         if rq.fakeworkerpipe:
             rq.fakeworkerpipe.setrunqueueexec(self)
 
+        if self.number_tasks <= 0:
+             bb.fatal("Invalid BB_NUMBER_THREADS %s" % self.number_tasks)
+
     def runqueue_process_waitpid(self, task, status):
 
         # self.build_stamps[pid] may not exist when use shared work directory.




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-06-19 11:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-19 11:27 [PATCH] runqueue: Sanity check BB_NUMBER_THREADS Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.