MagickCore 7.0.10
semaphore.c File Reference
Include dependency graph for semaphore.c:

Go to the source code of this file.

Data Structures

struct  SemaphoreInfo
 

Macros

#define AlignedExtent(size, alignment)    (((size)+((alignment)-1)) & ~((alignment)-1))
 

Functions

static void * AcquireSemaphoreMemory (const size_t count, const size_t quantum)
 
static void * RelinquishSemaphoreMemory (void *memory)
 
WizardExport SemaphoreInfoAcquireSemaphoreInfo (void)
 
WizardExport void ActivateSemaphoreInfo (SemaphoreInfo **semaphore_info)
 
WizardExport void LockSemaphoreInfo (SemaphoreInfo *semaphore_info)
 
WizardExport void RelinquishSemaphoreInfo (SemaphoreInfo **semaphore_info)
 
WizardExport WizardBooleanType SemaphoreComponentGenesis (void)
 
WizardExport void SemaphoreComponentTerminus (void)
 
WizardExport void UnlockSemaphoreInfo (SemaphoreInfo *semaphore_info)
 

Macro Definition Documentation

◆ AlignedExtent

#define AlignedExtent (   size,
  alignment 
)     (((size)+((alignment)-1)) & ~((alignment)-1))

Function Documentation

◆ AcquireSemaphoreInfo()

◆ AcquireSemaphoreMemory()

static void * AcquireSemaphoreMemory ( const size_t  count,
const size_t  quantum 
)
static

Definition at line 93 of file semaphore.c.

References AlignedExtent, and CACHE_LINE_SIZE.

Referenced by AcquireSemaphoreInfo().

◆ ActivateSemaphoreInfo()

◆ LockSemaphoreInfo()

WizardExport void LockSemaphoreInfo ( SemaphoreInfo semaphore_info)

Definition at line 282 of file semaphore.c.

References GetWizardThreadId(), SemaphoreInfo::id, IsWizardThreadEqual(), SemaphoreInfo::mutex, SemaphoreInfo::reference_count, SemaphoreInfo::signature, WizardFalse, and WizardSignature.

Referenced by AcquireFileLock(), AcquireUniqueFileResource(), AcquireWizardMemory(), AcquireWizardResource(), AddValueToSplayTree(), AppendValueToLinkedList(), CatchException(), ClearLinkedList(), ClearWizardException(), CloneSplayTree(), CloseWizardLog(), ConfigureComponentTerminus(), DeleteNodeByValueFromSplayTree(), DeleteNodeFromSplayTree(), DestroyBlob(), DestroyExceptionInfo(), DestroyFileInfo(), DestroyHashmap(), DestroyLinkedList(), DestroyRandomInfo(), DestroySplayTree(), DestroyWizardMemory(), GenerateEntropicChaos(), GetConfigureInfo(), GetConfigureInfoList(), GetConfigureList(), GetEntropyFromReservoir(), GetLastValueInLinkedList(), GetLocaleInfo_(), GetLocaleInfoList(), GetLocaleList(), GetLogInfo(), GetLogInfoList(), GetLogList(), GetMimeInfo(), GetMimeInfoList(), GetMimeList(), GetNextKeyInHashmap(), GetNextKeyInSplayTree(), GetNextValueInHashmap(), GetNextValueInLinkedList(), GetNextValueInSplayTree(), GetValueFromHashmap(), GetValueFromLinkedList(), GetValueFromSplayTree(), GetWizardResource(), GetWizardResourceLimit(), IncreaseHashmapCapacity(), InheritException(), InsertValueInLinkedList(), InsertValueInSortedLinkedList(), IsConfigureCacheInstantiated(), IsLocaleTreeInstantiated(), IsLogCacheInstantiated(), IsMimeCacheInstantiated(), LinkedListToArray(), ListWizardResourceInfo(), LocaleComponentTerminus(), LogComponentTerminus(), LogWizardEventList(), MimeComponentTerminus(), PutEntryInHashmap(), RelinquishWizardMemory(), RelinquishWizardResource(), RemoveElementByValueFromLinkedList(), RemoveElementFromLinkedList(), RemoveEntryFromHashmap(), RemoveLastElementFromLinkedList(), RemoveNodeByValueFromSplayTree(), RemoveNodeFromSplayTree(), ResetHashmapIterator(), ResetLinkedListIterator(), ResetSplayTree(), ResetSplayTreeIterator(), ResizeWizardMemory(), ResourceComponentTerminus(), SaveEntropyToReservoir(), SetLogEventMask(), SetLogFormat(), SetRandomKey(), SetWizardResourceLimit(), and ThrowException().

◆ RelinquishSemaphoreInfo()

◆ RelinquishSemaphoreMemory()

static void * RelinquishSemaphoreMemory ( void *  memory)
static

Definition at line 142 of file semaphore.c.

Referenced by RelinquishSemaphoreInfo().

◆ SemaphoreComponentGenesis()

WizardExport WizardBooleanType SemaphoreComponentGenesis ( void  )

Definition at line 386 of file semaphore.c.

References InitializeWizardMutex(), and WizardTrue.

Referenced by WizardsToolkitGenesis().

◆ SemaphoreComponentTerminus()

WizardExport void SemaphoreComponentTerminus ( void  )

Definition at line 410 of file semaphore.c.

References DestroyWizardMutex().

Referenced by WizardsToolkitTerminus().

◆ UnlockSemaphoreInfo()

WizardExport void UnlockSemaphoreInfo ( SemaphoreInfo semaphore_info)

Definition at line 437 of file semaphore.c.

References SemaphoreInfo::id, IsWizardThreadEqual(), SemaphoreInfo::mutex, SemaphoreInfo::reference_count, SemaphoreInfo::signature, WizardFalse, and WizardSignature.

Referenced by AcquireFileLock(), AcquireUniqueFileResource(), AcquireWizardMemory(), AcquireWizardResource(), AddValueToSplayTree(), AppendValueToLinkedList(), CatchException(), ClearLinkedList(), ClearWizardException(), CloneSplayTree(), CloseWizardLog(), ConfigureComponentTerminus(), DeleteNodeByValueFromSplayTree(), DeleteNodeFromSplayTree(), DestroyBlob(), DestroyExceptionInfo(), DestroyFileInfo(), DestroyHashmap(), DestroyLinkedList(), DestroyRandomInfo(), DestroySplayTree(), DestroyWizardMemory(), GenerateEntropicChaos(), GetConfigureInfo(), GetConfigureInfoList(), GetConfigureList(), GetEntropyFromReservoir(), GetLastValueInLinkedList(), GetLocaleInfo_(), GetLocaleInfoList(), GetLocaleList(), GetLogInfo(), GetLogInfoList(), GetLogList(), GetMimeInfo(), GetMimeInfoList(), GetMimeList(), GetNextKeyInHashmap(), GetNextKeyInSplayTree(), GetNextValueInHashmap(), GetNextValueInLinkedList(), GetNextValueInSplayTree(), GetValueFromHashmap(), GetValueFromLinkedList(), GetValueFromSplayTree(), GetWizardResource(), GetWizardResourceLimit(), IncreaseHashmapCapacity(), InheritException(), InsertValueInLinkedList(), InsertValueInSortedLinkedList(), IsConfigureCacheInstantiated(), IsLocaleTreeInstantiated(), IsLogCacheInstantiated(), IsMimeCacheInstantiated(), LinkedListToArray(), ListWizardResourceInfo(), LocaleComponentTerminus(), LogComponentTerminus(), LogWizardEventList(), MimeComponentTerminus(), PutEntryInHashmap(), RelinquishWizardMemory(), RelinquishWizardResource(), RemoveElementByValueFromLinkedList(), RemoveElementFromLinkedList(), RemoveEntryFromHashmap(), RemoveLastElementFromLinkedList(), RemoveNodeByValueFromSplayTree(), RemoveNodeFromSplayTree(), ResetHashmapIterator(), ResetLinkedListIterator(), ResetSplayTree(), ResetSplayTreeIterator(), ResizeWizardMemory(), ResourceComponentTerminus(), SaveEntropyToReservoir(), SetLogEventMask(), SetLogFormat(), SetRandomKey(), SetWizardResourceLimit(), and ThrowException().