From: cristy Date: Fri, 23 Oct 2009 19:00:35 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~10474 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bef641fd056a00b3646dee17e4cdffc01afd49d5;p=imagemagick --- diff --git a/magick/semaphore.c b/magick/semaphore.c index abba4ac39..6cc9e8287 100644 --- a/magick/semaphore.c +++ b/magick/semaphore.c @@ -81,9 +81,6 @@ static LONG static long semaphore_mutex = 0; #endif - -static MagickBooleanType - instantiate_semaphore = MagickFalse; /* Forward declaractions. @@ -172,7 +169,7 @@ MagickExport SemaphoreInfo *AllocateSemaphoreInfo(void) semaphore_info=(SemaphoreInfo *) RelinquishAlignedMemory( semaphore_info); ThrowFatalException(ResourceLimitFatalError, - "UnableToInstantiateSemaphoreComponent"); + "UnableToInitializeSemaphore"); } status=pthread_mutex_init(&semaphore_info->mutex,&mutex_info); (void) pthread_mutexattr_destroy(&mutex_info); @@ -181,7 +178,7 @@ MagickExport SemaphoreInfo *AllocateSemaphoreInfo(void) semaphore_info=(SemaphoreInfo *) RelinquishAlignedMemory( semaphore_info); ThrowFatalException(ResourceLimitFatalError, - "UnableToInstantiateSemaphoreComponent"); + "UnableToInitializeSemaphore"); } } #elif defined(MAGICKCORE_HAVE_WINTHREADS) @@ -217,11 +214,7 @@ MagickExport void DestroySemaphoreComponent(void) if (pthread_mutex_destroy(&semaphore_mutex) != 0) (void) fprintf(stderr,"pthread_mutex_destroy failed %s\n", GetExceptionMessage(errno)); -#elif defined(MAGICKCORE_HAVE_WINTHREADS) - if (instantiate_semaphore == MagickFalse) - DeleteCriticalSection(&semaphore_mutex); #endif - instantiate_semaphore=MagickFalse; } /* @@ -313,9 +306,6 @@ static void LockMagickMutex(void) (void) fprintf(stderr,"pthread_mutex_lock failed %s\n", GetExceptionMessage(errno)); #elif defined(MAGICKCORE_HAVE_WINTHREADS) - if (instantiate_semaphore == MagickFalse) - InitializeCriticalSection(&semaphore_mutex); - instantiate_semaphore=MagickTrue; while (InterlockedCompareExchange(&semaphore_mutex,1L,0L) != 0) Sleep(10); #endif