]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 19 Jan 2015 01:30:15 +0000 (01:30 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 19 Jan 2015 01:30:15 +0000 (01:30 +0000)
MagickCore/resource.c

index 6eb25a53ef91c98e6fde66aa287f1a442e75a0bf..330d79a481211dc1e979713110468cb6f2bb0797 100644 (file)
@@ -500,7 +500,12 @@ MagickExport int AcquireUniqueFileResource(char *path)
   assert(path != (char *) NULL);
   (void) LogMagickEvent(ResourceEvent,GetMagickModule(),"...");
   if (random_info == (RandomInfo *) NULL)
-    random_info=AcquireRandomInfo();
+    {
+      LockSemaphoreInfo(resource_semaphore);
+      if (random_info == (RandomInfo *) NULL)
+        random_info=AcquireRandomInfo();
+      UnlockSemaphoreInfo(resource_semaphore);
+    }
   file=(-1);
   for (i=0; i < (ssize_t) TMP_MAX; i++)
   {