From: cristy Date: Mon, 21 Nov 2011 18:32:43 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6617 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5fa207cb08d11af744a2eacf7dceab22c304ec7a;p=imagemagick --- 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