您的位置:首页 > 其它

windows多线程同步参考

2010-10-06 15:53 176 查看

Synchronization Functions

See Also

Synchronization Reference

The following table shows the kernel synchronization functions.

Programming elementDescription
CreateEventThis function creates a named or an unnamed event object.
CreateMutexThis function creates a named or unnamed mutex object.
CreateSemaphoreThis function creates a named or unnamed semaphore object.
DeleteCriticalSectionThis function releases all resources used by a critical section object that is not owned.
DuplicateHandleThis function 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.
EnterCriticalSectionThis function waits for ownership of the specified critical section object.
InitializeCriticalSectionThis function initializes a critical section object.
InterlockedCompareExchangeThis function performs an atomic comparison of the specified values and exchanges the values based on the outcome of the comparison.
InterlockedCompareExchangePointerThis function performs an atomic comparison of the specified parameter values and exchanges the values based on the outcome of the comparison.
InterlockedDecrementThis function both decrements (decreases by one) the value of the specified 32-bit variable and checks the resulting value.
InterlockedExchangeThis function atomically exchanges a pair of 32-bit values.
InterlockedExchangeAddThis function performs an atomic addition of an increment value to an Addend variable.
InterlockedExchangePointerThis function atomically exchanges a pair of values.
InterlockedIncrementThis function both increments (increases by one) the value of the specified 32-bit variable and checks the resulting value.
InterlockedTestExchangeThis function is an interlocked function that performs a conditional setting of a variable.
LeaveCriticalSectionThis function releases ownership of the specified critical section object.
OpenEventThis function opens an existing named event object.
PulseEventThis function 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.
ReleaseMutexThis function releases ownership of the specified mutex object.
ReleaseSemaphoreThis function increases the count of the specified semaphore object by a specified amount.
ResetEventThis function sets the state of the specified event object to nonsignaled.
SetEventThis function sets the state of the specified event object to signaled.
TryEnterCriticalSectionThis function attempts to enter a critical section without blocking.
WaitForMultipleObjectsThis function returns when either any one of the specified objects is in the signaled state, or the time-out interval elapses.
WaitForSingleObjectThis function returns when the specified object is in the signaled state or when the time-out interval elapses.

See Also

Synchronization Reference
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: