From 5fa207cb08d11af744a2eacf7dceab22c304ec7a Mon Sep 17 00:00:00 2001 From: cristy Date: Mon, 21 Nov 2011 18:32:43 +0000 Subject: [PATCH] --- MagickCore/thread-private.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MagickCore/thread-private.h b/MagickCore/thread-private.h index 497f13fba..428286547 100644 --- a/MagickCore/thread-private.h +++ b/MagickCore/thread-private.h @@ -24,8 +24,6 @@ extern "C" { #include -#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 -- 2.40.0