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.
GetOverlappedResult Retrieves 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.
InitializeCriticalSectionAndSpinCount Initializes 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
CreateEvent Creates 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.
InterlockedCompareExchangePointer Performs an atomic comparison of the specified values and exchange of the values, based on the outcome of the comparison.
InterlockedDecrement Decrements (decreases by one) the value of the specified variable and checks the resulting value.
InterlockedExchange Atomically exchanges a pair of values.
InterlockedExchangeAdd Performs an atomic addition of an increment value to an addend variable.
InterlockedExchangePointer Atomically exchanges a pair of values.
InterlockedIncrement Increments (increases by one) the value of the specified variable and checks the resulting value.

Mutex Function Description
CreateMutex Creates or opens a named or unnamed mutex object.
OpenMutex Opens an existing named mutex object.
ReleaseMutex Releases 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.
ReleaseSemaphore Increases the count of the specified semaphore object by a specified amount.

Timer-Queue Timer Function Description
ChangeTimerQueueTimer Updates a timer-queue timer.
CreateTimerQueue Creates a queue for timers.
CreateTimerQueueTimer Creates a timer-queue timer.
DeleteTimerQueue Deletes a timer queue.
DeleteTimerQueueEx Deletes a timer queue.
DeleteTimerQueueTimer Cancels a timer-queue timer.

Wait Function Description
MsgWaitForMultipleObjects Returns when the specified criteria for the specified objects is met.
MsgWaitForMultipleObjectsEx Returns when the specified criteria for the specified objects is met.
RegisterWaitForSingleObject Directs 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
CancelWaitableTimer Sets the specified waitable timer to the inactive state.
CreateWaitableTimer Creates 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.