Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] utils: Add a cpu_count wrapper function
@ 2014-01-27 14:38 Richard Purdie
  2014-01-27 16:44 ` Otavio Salvador
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2014-01-27 14:38 UTC (permalink / raw)
  To: openembedded-core

Add a cpu_count wrapper function (useful from annonymous python where
the import would be trickier).

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
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()




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-27 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-27 14:38 [PATCH] utils: Add a cpu_count wrapper function Richard Purdie
2014-01-27 16:44 ` Otavio Salvador

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox