windows內核同步函數

windows內核提供了一系列的同步函數:在msdn上的連接以下: windows

http://msdn.microsoft.com/zh-cn/library/aa909196.aspx app

The following table shows the kernel synchronization functions. ide

Functions Description

CreateEvent 函數

Creates a named or an unnamed event object. atom

CreateMutex spa

Creates a named or unnamed mutex object. orm

CreateSemaphore ip

Creates a named or unnamed semaphore object. ci

DeleteCriticalSection rem

Releases all resources used by a critical section object that is not owned.

DuplicateHandle

Duplicates an object handle. The duplicate handle refers to the same object as the original handle. Therefore, any changes to the object are reflected through both handles.

EnterCriticalSection

Waits for ownership of the specified critical section object.

InitializeCriticalSection

Initializes a critical section object.

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 parameter values and exchanges the values based on the outcome of the comparison.

InterlockedDecrement

Decrements the value of the specified 32-bit variable, and checks the resulting value.

InterlockedExchange

Exchanges a pair of 32-bit values.

InterlockedExchangeAdd

Increments an Addend variable.

InterlockedExchangePointer

Exchanges a pair of values.

InterlockedIncrement

Increments the value of the specified 32-bit variable, and checks the resulting value.

InterlockedTestExchange

Performs a conditional setting of a variable.

LeaveCriticalSection

Releases ownership of the specified critical section object.

OpenEvent

Opens an existing named event object.

PulseEvent

Provides a single operation that sets to signaled the state of the specified event object and then resets it to nonsignaled after releasing the appropriate number of waiting threads.

ReleaseMutex

Releases ownership of the specified mutex object.

ReleaseSemaphore

Increases the count of the specified semaphore object by a specified amount.

ResetEvent

Sets the state of the specified event object to nonsignaled.

SetEvent

Sets the state of the specified event object to signaled.

TryEnterCriticalSection

Attempts to enter a critical section without blocking.

WaitForMultipleObjects

Returns when either any one of the specified objects is in the signaled state, or the time-out interval elapses.

WaitForSingleObject

Returns when the specified object is in the signaled state or when the time-out interval elapses.

相關文章
相關標籤/搜索