[libdispatch-dev] Solaris portability, online CPU count detection - PATCH [3/6]

Joakim Johansson jocke at tbricks.com
Fri Nov 6 07:01:30 PST 2009


Joakim

 > svn diff queue.c
Index: queue.c
===================================================================
--- queue.c	(revision 140)
+++ queue.c	(working copy)
@@ -473,6 +473,13 @@
  	_dispatch_hw_config.cc_max_logical =
  	    _dispatch_hw_config.cc_max_physical =
  	    _dispatch_hw_config.cc_max_active;
+#elif defined (__SVR4) && defined (__sun)
+	_dispatch_hw_config.cc_max_active = (int) sysconf 
(_SC_NPROCESSORS_ONLN);
+
+	_dispatch_hw_config.cc_max_logical =
+	_dispatch_hw_config.cc_max_physical =
+	_dispatch_hw_config.cc_max_active;
+	
  #else
  #warning "_dispatch_queue_set_width_init: no supported way to query  
CPU count"
  	_dispatch_hw_config.cc_max_logical =




More information about the libdispatch-dev mailing list