Synchronization Functions
 FrontPage|FindPage|TitleIndex|RecentChanges|UserPreferences E D R S P I M H RSS

SubCategoryCppSubCategoryDatabaseSubCategoryGameServerSubCategoryNetworkSubCategorySystem › Synchronization Functions
Platform SDK: DLLs, Processes, and Threads

Synchronization Functions #


The following functions are used in synchronization.

Asynchronous function Description
APCProc An application-defined callback function used with the QueueUserAPC function.
GetOverlappedResultRetrieves the results of an overlapped operation.
QueueUserAPC Adds a user-mode asynchronous procedure call (APC) object to the APC queue of the specified thread.

Critical-section function Description
DeleteCriticalSection Releases all resources used by an unowned critical section object.
EnterCriticalSection Waits for ownership of the specified critical section object.
InitializeCriticalSection Initializes a critical section object.
InitializeCriticalSectionAndSpinCountInitializes a critical section object and sets the spin count for the critical section.
LeaveCriticalSection Releases ownership of the specified critical section object.
SetCriticalSectionSpinCount Sets the spin count for the specified critical section.
TryEnterCriticalSection Attempts to enter a critical section without blocking.

Event function Description
CreateEventCreates or opens a named or unnamed event object.
OpenEvent Opens an existing named event object.
PulseEvent Sets the specified event object to the signaled state and then resets it to the nonsignaled state after releasing the appropriate number of waiting threads.
ResetEvent Sets the specified event object to the nonsignaled state.
SetEvent Sets the specified event object to the signaled state.

Interlocked function Description
InterlockedCompareExchange Performs an atomic comparison of the specified values and exchanges the values, based on the outcome of the comparison.
InterlockedCompareExchangeAcquire Functions identically to InterlockedCompareExchange except that acquire memory access semantics are used in the exchange operation.
InterlockedCompareExchangeAcquire64Functions identically to InterlockedCompareExchangeAcquire except that operations are performed on 64-bit values and addresses.
InterlockedCompareExchangePointer Performs an atomic comparison of the specified values and exchange of the values, based on the outcome of the comparison.
InterlockedCompareExchangeRelease Functions identically to InterlockedCompareExchange except that release memory access semantics are used in the exchange operation.
InterlockedCompareExchangeRelease64Functions identically to InterlockedCompareExchangeRelease except that operations are performed on 64-bit values and addresses.
InterlockedDecrement Decrements (decreases by one) the value of the specified variable and checks the resulting value.
InterlockedDecrement64 Functions identically to InterlockedDecrement except that operations are performed on 64-bit values and addresses.
InterlockedDecrementAcquire Functions identically to InterlockedDecrement except that acquire memory access semantics are used in the exchange operation.
InterlockedDecrementRelease Functions identically to InterlockedDecrement except that release memory access semantics are used in the exchange operation.
InterlockedExchange Atomically exchanges a pair of values.
InterlockedExchangeAcquire64 Functions identically to InterlockedExchange except that acquire memory access semantics are used in the exchange operation and it processes 64-bit values and addresses.
InterlockedExchangeAdd Performs an atomic addition of an increment value to an addend variable.
InterlockedExchangePointer Atomically exchanges a pair of values.
InterlockedFlushSList Removes all items from a singly linked list.
InterlockedIncrement Increments (increases by one) the value of the specified variable and checks the resulting value.
InterlockedIncrement64 Functions identically to InterlockedIncrement except that operations are performed on 64-bit values and addresses.
InterlockedIncrementAcquire Functions identically to InterlockedIncrement except that acquire memory access semantics are used in the exchange operation.
InterlockedIncrementRelease Functions identically to InterlockedIncrement except that release memory access semantics are used in the exchange operation.
InterlockedPopEntrySList Removes an item from the front of a singly linked list.
InterlockedPushEntrySList Inserts an item at the front of a singly linked list.

Mutex function Description
CreateMutex Creates or opens a named or unnamed mutex object.
OpenMutex Opens an existing named mutex object.
ReleaseMutexReleases ownership of the specified mutex object.

Semaphore function Description
CreateSemaphore Creates or opens a named or unnamed semaphore object.
OpenSemaphore Opens an existing named semaphore object.
ReleaseSemaphoreIncreases the count of the specified semaphore object by a specified amount.

Singly-linked list function Description
InitializeSListHead Initializes the head of a singly linked list.
InterlockedFlushSList Flushes the entire list of items in a singly linked list.
InterlockedPopEntrySList Removes an item from the front of a singly linked list.
InterlockedPushEntrySListInserts an item at the front of a singly linked list.

Timer-queue timer function Description
ChangeTimerQueueTimerUpdates a timer-queue timer.
CreateTimerQueue Creates a queue for timers.
CreateTimerQueueTimerCreates a timer-queue timer.
DeleteTimerQueue Deletes a timer queue.
DeleteTimerQueueEx Deletes a timer queue.
DeleteTimerQueueTimerCancels a timer-queue timer.

Wait function Description
MsgWaitForMultipleObjects Returns when the specified criteria for the specified objects is met.
MsgWaitForMultipleObjectsExReturns when the specified criteria for the specified objects is met.
RegisterWaitForSingleObjectDirects a wait thread in the thread pool to wait on the object.
SignalObjectAndWait Allows the caller to atomically signal an object and wait on another object.
UnregisterWait Cancels a registered wait operation.
UnregisterWaitEx Cancels a registered wait operation.
WaitForMultipleObjects Returns when the specified criteria for the specified objects is met.
WaitForMultipleObjectsEx Returns when the specified criteria for the specified objects is met.
WaitForSingleObject Returns when the specified criteria for the specified object is met.
WaitForSingleObjectEx Returns when the specified criteria for the specified object is met.
WaitOrTimerCallback Returns when the specified criteria is met.

Waitable-timer function Description
CancelWaitableTimerSets the specified waitable timer to the inactive state.
CreateWaitableTimerCreates or opens a waitable timer object.
OpenWaitableTimer Opens an existing named waitable timer object.
SetWaitableTimer Activates the specified waitable timer.
TimerAPCProc Application-defined timer completion routine used with the SetWaitableTimer function.

EditText|FindPage|DeletePage|LikePages| Valid XHTML 1.0! Valid CSS! powered by MoniWiki