]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Fri, 23 Oct 2009 19:00:35 +0000 (19:00 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Fri, 23 Oct 2009 19:00:35 +0000 (19:00 +0000)
magick/semaphore.c

index abba4ac3923239a825f08061b2605ed13df8f424..6cc9e8287a7d5ba499c78921db0bd114d5aca9cb 100644 (file)
@@ -81,9 +81,6 @@ static LONG
 static long
   semaphore_mutex = 0;
 #endif
-
-static MagickBooleanType
-  instantiate_semaphore = MagickFalse;
 \f
 /*
   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;
 }
 \f
 /*
@@ -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