static MagickBooleanType IsModuleTreeInstantiated(
ExceptionInfo *magick_unused(exception))
{
- if (module_semaphore == (SemaphoreInfo *) NULL)
- ActivateSemaphoreInfo(&module_semaphore);
- LockSemaphoreInfo(module_semaphore);
if (module_list == (SplayTreeInfo *) NULL)
{
- MagickBooleanType
- status;
-
- ModuleInfo
- *module_info;
-
- module_list=NewSplayTree(CompareSplayTreeString,
- (void *(*)(void *)) NULL,DestroyModuleNode);
+ if (module_semaphore == (SemaphoreInfo *) NULL)
+ ActivateSemaphoreInfo(&module_semaphore);
+ LockSemaphoreInfo(module_semaphore);
if (module_list == (SplayTreeInfo *) NULL)
- ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
- module_info=AcquireModuleInfo((const char *) NULL,"[boot-strap]");
- module_info->stealth=MagickTrue;
- status=AddValueToSplayTree(module_list,module_info->tag,module_info);
- if (status == MagickFalse)
- ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
- if (lt_dlinit() != 0)
- ThrowFatalException(ModuleFatalError,"UnableToInitializeModuleLoader");
+ {
+ MagickBooleanType
+ status;
+
+ ModuleInfo
+ *module_info;
+
+ module_list=NewSplayTree(CompareSplayTreeString,
+ (void *(*)(void *)) NULL,DestroyModuleNode);
+ if (module_list == (SplayTreeInfo *) NULL)
+ ThrowFatalException(ResourceLimitFatalError,
+ "MemoryAllocationFailed");
+ module_info=AcquireModuleInfo((const char *) NULL,"[boot-strap]");
+ module_info->stealth=MagickTrue;
+ status=AddValueToSplayTree(module_list,module_info->tag,module_info);
+ if (status == MagickFalse)
+ ThrowFatalException(ResourceLimitFatalError,
+ "MemoryAllocationFailed");
+ if (lt_dlinit() != 0)
+ ThrowFatalException(ModuleFatalError,
+ "UnableToInitializeModuleLoader");
+ }
+ UnlockSemaphoreInfo(module_semaphore);
}
- UnlockSemaphoreInfo(module_semaphore);
return(module_list != (SplayTreeInfo *) NULL ? MagickTrue : MagickFalse);
}
\f
MagickBooleanType
status;
- module_semaphore=AcquireSemaphoreInfo();
+ if (module_semaphore == (SemaphoreInfo *) NULL)
+ module_semaphore=AcquireSemaphoreInfo();
exception=AcquireExceptionInfo();
status=IsModuleTreeInstantiated(exception);
exception=DestroyExceptionInfo(exception);