diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-27 14:38:08 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-28 00:50:47 +0000 |
commit | 721773072da08cf0f5e1206961ada3083b6722b4 (patch) | |
tree | 805e0deaaed1d50623fdf71a3d9715421ee7e236 /meta | |
parent | 52801925554191efce8c20a98cd5cf5e8488977b (diff) | |
download | poky-721773072da08cf0f5e1206961ada3083b6722b4.tar.gz |
utils: Add a cpu_count wrapper function
Add a cpu_count wrapper function (useful from annonymous python where
the import would be trickier).
(From OE-Core rev: 0ae27a55759e7c4254e704e18b304d40013cb5c3)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oe/utils.py | 4 |
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): | |||
150 | parts = version.split(".") | 150 | parts = version.split(".") |
151 | trimmed = ".".join(parts[:num_parts]) | 151 | trimmed = ".".join(parts[:num_parts]) |
152 | return trimmed | 152 | return trimmed |
153 | |||
154 | def cpu_count(): | ||
155 | import multiprocessing | ||
156 | return multiprocessing.cpu_count() | ||