% March 2000 %
% %
% %
-% Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
void
*value;
- unsigned long
+ size_t
signature;
} RegistryInfo;
\f
% %
% %
% %
-% D e s t r o y R e g i s t r y C o m p o n e n t %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% DestroyRegistryComponent() destroys the registry component.
-%
-% The format of the DestroyDefines method is:
-%
-% void DestroyRegistryComponent(void)
-%
-*/
-MagickExport void DestroyRegistryComponent(void)
-{
- AcquireSemaphoreInfo(®istry_semaphore);
- if (IsEventLogging() != MagickFalse)
- (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
- if (registry != (void *) NULL)
- registry=DestroySplayTree(registry);
- instantiate_registry=MagickFalse;
- RelinquishSemaphoreInfo(registry_semaphore);
- DestroySemaphoreInfo(®istry_semaphore);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
% G e t I m a g e R e g i s t r y %
% %
% %
% %
% %
% %
-+ I n s t a n t i a t e R e g i s t r y C o m p o n e n t %
++ R e g i s t r y C o m p o n e n t G e n e s i s %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% InstantiateRegistryComponent() instantiates the registry component.
+% RegistryComponentGenesis() instantiates the registry component.
%
-% The format of the InstantiateRegistryComponent method is:
+% The format of the RegistryComponentGenesis method is:
%
-% MagickBooleanType InstantiateRegistryComponent(void)
+% MagickBooleanType RegistryComponentGenesis(void)
%
*/
-MagickExport MagickBooleanType InstantiateRegistryComponent(void)
+MagickExport MagickBooleanType RegistryComponentGenesis(void)
{
AcquireSemaphoreInfo(®istry_semaphore);
- RelinquishSemaphoreInfo(registry_semaphore);
return(MagickTrue);
}
\f
% %
% %
% %
+% R e g i s t r y C o m p o n e n t T e r m i n u s %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% RegistryComponentTerminus() destroys the registry component.
+%
+% The format of the DestroyDefines method is:
+%
+% void RegistryComponentTerminus(void)
+%
+*/
+MagickExport void RegistryComponentTerminus(void)
+{
+ if (registry_semaphore == (SemaphoreInfo *) NULL)
+ AcquireSemaphoreInfo(®istry_semaphore);
+ LockSemaphoreInfo(registry_semaphore);
+ if (IsEventLogging() != MagickFalse)
+ (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
+ if (registry != (void *) NULL)
+ registry=DestroySplayTree(registry);
+ instantiate_registry=MagickFalse;
+ UnlockSemaphoreInfo(registry_semaphore);
+ DestroySemaphoreInfo(®istry_semaphore);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
% R e m o v e I m a g e R e g i s t r y %
% %
% %
if ((registry == (SplayTreeInfo *) NULL) &&
(instantiate_registry == MagickFalse))
{
- AcquireSemaphoreInfo(®istry_semaphore);
+ if (registry_semaphore == (SemaphoreInfo *) NULL)
+ AcquireSemaphoreInfo(®istry_semaphore);
+ LockSemaphoreInfo(registry_semaphore);
if ((registry == (SplayTreeInfo *) NULL) &&
(instantiate_registry == MagickFalse))
{
DestroyRegistryNode);
instantiate_registry=MagickTrue;
}
- RelinquishSemaphoreInfo(registry_semaphore);
+ UnlockSemaphoreInfo(registry_semaphore);
}
status=AddValueToSplayTree(registry,ConstantString(key),registry_info);
return(status);