mirror of
git://git.yoctoproject.org/poky
synced 2026-08-14 21:01:51 +00:00
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:
parent
5280192555
commit
721773072d
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user