mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 05:29:32 +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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user