]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/thread-private.h
(no commit message)
[imagemagick] / MagickCore / thread-private.h
index 428286547b957ab012136c588f70a11771886c79..add3a0e2db72eb392265fd4243ffdcf764c7025b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization
+  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
   dedicated to making software imaging solutions freely available.
 
   You may not use this file except in compliance with the License.
@@ -31,6 +31,8 @@ extern "C" {
 #define MagickCachePrefetch(address,mode,locality)
 #endif
 
+#define omp_concurrent(concurrent) \
+  num_threads((concurrent) != MagickFalse ? omp_get_max_threads() : 1)
 #define omp_throttle(factor)  num_threads(omp_get_max_threads() >> \
    (factor) == 0 ? 1 : omp_get_max_threads() >> (factor))
 
@@ -100,7 +102,7 @@ static inline size_t GetOpenMPMaximumThreads(void)
   static size_t
     maximum_threads = 1;
 
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP >= 200203)
+#if defined(MAGICKCORE_OPENMP_SUPPORT)
   {
     ssize_t
       threads;
@@ -115,7 +117,7 @@ static inline size_t GetOpenMPMaximumThreads(void)
 
 static inline int GetOpenMPThreadId(void)
 {
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP >= 200203)
+#if defined(MAGICKCORE_OPENMP_SUPPORT)
   return(omp_get_thread_num());
 #else
   return(0);
@@ -124,7 +126,7 @@ static inline int GetOpenMPThreadId(void)
 
 static inline void SetOpenMPMaximumThreads(const int threads)
 {
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP >= 200203)
+#if defined(MAGICKCORE_OPENMP_SUPPORT)
   omp_set_num_threads(threads);
 #else
   (void) threads;
@@ -133,7 +135,7 @@ static inline void SetOpenMPMaximumThreads(const int threads)
 
 static inline void SetOpenMPNested(const int value)
 {
-#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP >= 200203)
+#if defined(MAGICKCORE_OPENMP_SUPPORT)
   omp_set_nested(value);
 #else
   (void) value;