]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 21 Nov 2011 18:32:43 +0000 (18:32 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 21 Nov 2011 18:32:43 +0000 (18:32 +0000)
MagickCore/thread-private.h

index 497f13fba9cbb05764a51fea4204fe53ad34ec1d..428286547b957ab012136c588f70a11771886c79 100644 (file)
@@ -24,8 +24,6 @@ extern "C" {
 
 #include <MagickCore/thread_.h>
 
-#define omp_throttle(factor)  num_threads(omp_get_max_threads() >> (factor))
-
 #if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR > 10))
 #define MagickCachePrefetch(address,mode,locality) \
   __builtin_prefetch(address,mode,locality)
@@ -33,6 +31,9 @@ extern "C" {
 #define MagickCachePrefetch(address,mode,locality)
 #endif
 
+#define omp_throttle(factor)  num_threads(omp_get_max_threads() >> \
+   (factor) == 0 ? 1 : omp_get_max_threads() >> (factor))
+
 #if defined(MAGICKCORE_THREAD_SUPPORT)
   typedef pthread_mutex_t MagickMutexType;
 #elif defined(MAGICKCORE_WINDOWS_SUPPORT)
@@ -124,7 +125,7 @@ static inline int GetOpenMPThreadId(void)
 static inline void SetOpenMPMaximumThreads(const int threads)
 {
 #if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP >= 200203)
-  omp_set_num_threads(threads < 1 ? 1 : threads);
+  omp_set_num_threads(threads);
 #else
   (void) threads;
 #endif