[vlc-devel] [PATCH v4 03/18] misc/thread_nocancel: Fall back to _SC_NPROCESSORS_ONLN
Julian Scheel
julian at jusst.de
Wed Mar 22 09:58:51 CET 2017
From: Dennis Hamester <dennis.hamester at startmail.com>
NaCl does not define _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN is
the best approximation we have got.
---
src/misc/thread_nocancel.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/misc/thread_nocancel.c b/src/misc/thread_nocancel.c
index 8056dbc209..c3c99cbfef 100644
--- a/src/misc/thread_nocancel.c
+++ b/src/misc/thread_nocancel.c
@@ -417,5 +417,9 @@ mtime_t mdate (void)
unsigned vlc_GetCPUCount(void)
{
+#ifdef _SC_NPROCESSORS_CONF
return sysconf(_SC_NPROCESSORS_CONF);
+#else
+ return sysconf(_SC_NPROCESSORS_ONLN);
+#endif
}
--
2.12.0
More information about the vlc-devel
mailing list