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>
This commit is contained in:
Richard Purdie committed 2014-01-28 00:50:47 +00:00
1 parent 5280192555
commit 721773072d
1 file changed
+4
+4
View File
@@ -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()