All pastes #910412 Raw Edit

Untitled

public text v1 · immutable
·published 2008-02-19 22:50 UTC
rendered paste body
Index: source/blender/blenlib/intern/threads.c
===================================================================
--- source/blender/blenlib/intern/threads.c     (revision 13774)
+++ source/blender/blenlib/intern/threads.c     (working copy)
@@ -228,7 +228,15 @@
 /* how many threads are native on this system? */
 int BLI_system_thread_count( void )
 {
-       int t = (int)sysconf(_SC_NPROCESSORS_ONLN);
+       int t;
+#ifdef WIN32
+       SYSTEM_INFO info;
+       GetSystemInfo(&info);
+       t = (int) info.dwNumberOfProcessors;
+#else
+       t = (int)sysconf(_SC_NPROCESSORS_ONLN);
+#endif
+
        if (t>RE_MAX_THREAD)
                return RE_MAX_THREAD;
        if (t<1)