diff options
| -rw-r--r-- | bitbake/lib/bb/command.py | 6 | ||||
| -rw-r--r-- | bitbake/lib/bb/utils.py | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index 2a3a3afaca..4e9e8d657e 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py | |||
| @@ -173,6 +173,12 @@ class CommandsSync: | |||
| 173 | """ | 173 | """ |
| 174 | command.cooker.reset() | 174 | command.cooker.reset() |
| 175 | 175 | ||
| 176 | def getCpuCount(self, command, params): | ||
| 177 | """ | ||
| 178 | Get the CPU count on the bitbake server | ||
| 179 | """ | ||
| 180 | return bb.utils.cpu_count() | ||
| 181 | |||
| 176 | 182 | ||
| 177 | class CommandsAsync: | 183 | class CommandsAsync: |
| 178 | """ | 184 | """ |
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index a26635a19a..d7cefb245f 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
| @@ -25,6 +25,7 @@ import errno | |||
| 25 | import logging | 25 | import logging |
| 26 | import bb | 26 | import bb |
| 27 | import bb.msg | 27 | import bb.msg |
| 28 | import multiprocessing | ||
| 28 | from commands import getstatusoutput | 29 | from commands import getstatusoutput |
| 29 | from contextlib import contextmanager | 30 | from contextlib import contextmanager |
| 30 | 31 | ||
| @@ -862,3 +863,6 @@ def contains(variable, checkvalues, truevalue, falsevalue, d): | |||
| 862 | if checkvalues.issubset(val): | 863 | if checkvalues.issubset(val): |
| 863 | return truevalue | 864 | return truevalue |
| 864 | return falsevalue | 865 | return falsevalue |
| 866 | |||
| 867 | def cpu_count(): | ||
| 868 | return multiprocessing.cpu_count() | ||
