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 | |
parent | 52801925554191efce8c20a98cd5cf5e8488977b (diff) | |
download | ast2050-yocto-poky-721773072da08cf0f5e1206961ada3083b6722b4.zip ast2050-yocto-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>
-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 82987e8..36f82db 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() |