utils: Add a cpu_count wrapper function
PATCH 1/1 utils: Add a cpu_count wrapper function
Add a cpu_count wrapper function (useful from annonymous python where the import would be trickier).
Signed-off-by Richard Purdie <[email protected]>
---
meta/lib/oe/utils.py +4 -0
@@ -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()
Quoted 4 lines · Richard Purdie
Add a
cpu_countwrapper function (useful from annonymous python where the import would be trickier).Signed-off-by Richard Purdie <[email protected]>
Acked-by Otavio Salvador <[email protected]>
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750