exception=AcquireExceptionInfo();
(void) GetLogInfo("*",exception);
exception=DestroyExceptionInfo(exception);
+ event_semaphore=AcquireSemaphoreInfo();
return(MagickTrue);
}
\f
MagickPrivate void LogComponentTerminus(void)
{
+ if (event_semaphore == (SemaphoreInfo *) NULL)
+ ActivateSemaphoreInfo(&event_semaphore);
+ LockSemaphoreInfo(event_semaphore);
+ UnlockSemaphoreInfo(event_semaphore);
+ RelinquishSemaphoreInfo(&event_semaphore);
if (log_semaphore == (SemaphoreInfo *) NULL)
ActivateSemaphoreInfo(&log_semaphore);
LockSemaphoreInfo(log_semaphore);
exception=AcquireExceptionInfo();
log_info=(LogInfo *) GetLogInfo("*",exception);
exception=DestroyExceptionInfo(exception);
- LockSemaphoreInfo(log_semaphore);
+ if (event_semaphore == (SemaphoreInfo *) NULL)
+ ActivateSemaphoreInfo(&event_semaphore);
+ LockSemaphoreInfo(event_semaphore);
if ((log_info->event_mask & type) == 0)
{
- UnlockSemaphoreInfo(log_semaphore);
+ UnlockSemaphoreInfo(event_semaphore);
return(MagickTrue);
}
domain=CommandOptionToMnemonic(MagickLogEventOptions,type);
if (text == (char *) NULL)
{
(void) ContinueTimer((TimerInfo *) &log_info->timer);
- UnlockSemaphoreInfo(log_semaphore);
+ UnlockSemaphoreInfo(event_semaphore);
return(MagickFalse);
}
if ((log_info->handler_mask & ConsoleHandler) != 0)
if (filename == (char *) NULL)
{
(void) ContinueTimer((TimerInfo *) &log_info->timer);
- UnlockSemaphoreInfo(log_semaphore);
+ UnlockSemaphoreInfo(event_semaphore);
return(MagickFalse);
}
log_info->append=IsPathAccessible(filename);
filename=(char *) RelinquishMagickMemory(filename);
if (log_info->file == (FILE *) NULL)
{
- UnlockSemaphoreInfo(log_semaphore);
+ UnlockSemaphoreInfo(event_semaphore);
return(MagickFalse);
}
log_info->generation++;
}
text=(char *) RelinquishMagickMemory(text);
(void) ContinueTimer((TimerInfo *) &log_info->timer);
- UnlockSemaphoreInfo(log_semaphore);
+ UnlockSemaphoreInfo(event_semaphore);
return(MagickTrue);
}