18 #ifndef MAGICKCORE_SEMAPHORE_PRIVATE_H
19 #define MAGICKCORE_SEMAPHORE_PRIVATE_H
21 #if defined(__cplusplus) || defined(c_plusplus)
31 #if defined(MAGICKCORE_OPENMP_SUPPORT)
34 #elif defined(MAGICKCORE_THREAD_SUPPORT)
35 static pthread_mutex_t
36 semaphore_mutex = PTHREAD_MUTEX_INITIALIZER;
37 #elif defined(MAGICKCORE_WINDOWS_SUPPORT)
50 #if defined(MAGICKCORE_OPENMP_SUPPORT)
52 omp_destroy_lock(&semaphore_mutex);
59 #if defined(MAGICKCORE_OPENMP_SUPPORT)
61 omp_init_lock(&semaphore_mutex);
68 #if defined(MAGICKCORE_OPENMP_SUPPORT)
69 omp_set_lock(&semaphore_mutex);
70 #elif defined(MAGICKCORE_THREAD_SUPPORT)
75 status=pthread_mutex_lock(&semaphore_mutex);
82 #elif defined(MAGICKCORE_WINDOWS_SUPPORT)
83 while (InterlockedCompareExchange(&semaphore_mutex,1L,0L) != 0)
90 #if defined(MAGICKCORE_OPENMP_SUPPORT)
91 omp_unset_lock(&semaphore_mutex);
92 #elif defined(MAGICKCORE_THREAD_SUPPORT)
97 status=pthread_mutex_unlock(&semaphore_mutex);
104 #elif defined(MAGICKCORE_WINDOWS_SUPPORT)
105 InterlockedExchange(&semaphore_mutex,0L);
109 #if defined(__cplusplus) || defined(c_plusplus)
MagickPrivate MagickBooleanType SemaphoreComponentGenesis(void)
Definition: semaphore.c:399
static void UnlockMagickMutex(void)
Definition: semaphore-private.h:88
#define ThrowFatalException(severity, tag)
Definition: exception-private.h:35
static ssize_t semaphore_mutex
Definition: semaphore-private.h:42
static MagickBooleanType active_mutex
Definition: semaphore-private.h:46
static void InitializeMagickMutex(void)
Definition: semaphore-private.h:57
static void LockMagickMutex(void)
Definition: semaphore-private.h:66
Definition: exception.h:77
MagickBooleanType
Definition: magick-type.h:158
Definition: magick-type.h:161
static void DestroyMagickMutex(void)
Definition: semaphore-private.h:48
MagickPrivate void SemaphoreComponentTerminus(void)
Definition: semaphore.c:423
Definition: magick-type.h:160
#define MagickPrivate
Definition: method-attribute.h:81