Creates or opens a named or unnamed event object 第二个参数为TRUE代表手动,为FALSE代表自动 第三个参数代表初始状态是否为触发状态
OpenEvent
Opens an existing named event object.
SetEvent
Sets the specified event object to the signaled state.
ResetEvent
Sets the specified event object to the nonsignaled state.
情况
手动重置事件
自动重置事件
事件内核对象被触发
所有等待该事件的线程均变为可调度状态
只有一个等待该事件的线程变为可调度状态
等待事件内核对象成功的副作用
无
自动置为非触发状态
可等待的计时器内核对象
函数
功能
CreateWaitableTimer
Creates or opens a waitable timer object. 第二个参数:TRUE表示手动重置,为FALSE表示为自动重置
OpenWaitableTimer
Opens an existing named waitable timer object.
SetWaitableTimer
Activates the specified waitable timer. When the due time arrives, the timer is signaled and the thread that set the timer calls the optional completion routine.
CancelWaitableTimer
Sets the specified waitable timer to the inactive state.
The state of a mutex object is signaled when it is not owned by any thread. The creating thread can use the bInitialOwner flag to request immediate ownership of the mutex. Otherwise, a thread must use one of the wait functions to request ownership. When the mutex's state is signaled, one waiting thread is granted ownership, the mutex's state changes to nonsignaled, and the wait function returns. Only one thread can own a mutex at any given time. The owning thread uses the ReleaseMutex function to release its ownership.
The thread that owns a mutex can specify the same mutex in repeated wait function calls without blocking its execution. Typically, you would not wait repeatedly for the same mutex, but this mechanism prevents a thread from deadlocking itself while waiting for a mutex that it already owns. However, to release its ownership, the thread must call ReleaseMutex once for each time that the mutex satisfied a wait. 参考资料https://docs.microsoft.com/en-us/windows/desktop/api/synchapi/nf-synchapi-createmutexa