summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-27 14:38:08 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-27 22:08:58 +0000
commit0ae27a55759e7c4254e704e18b304d40013cb5c3 (patch)
treee8d13288f4b7539b8f8720b2dd38fb4cb8c1a499 /meta
parent24d5b449e5f4d91119f0d8e13c457618811aadfc (diff)
downloadopenembedded-core-0ae27a55759e7c4254e704e18b304d40013cb5c3.tar.gz
openembedded-core-0ae27a55759e7c4254e704e18b304d40013cb5c3.tar.bz2
openembedded-core-0ae27a55759e7c4254e704e18b304d40013cb5c3.zip
utils: Add a cpu_count wrapper function
Add a cpu_count wrapper function (useful from annonymous python where the import would be trickier). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 82987e80d0..36f82dbbec 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -150,3 +150,7 @@ def trim_version(version, num_parts=2):
parts = version.split(".")
trimmed = ".".join(parts[:num_parts])
return trimmed
+
+def cpu_count():
+ import multiprocessing
+ return multiprocessing.cpu_count()