事件(Event)

多用于线程同步。

可能用到的函数:

1.CreateEventW

HANDLE CreateEventW(
  LPSECURITY_ATTRIBUTES lpEventAttributes,
  BOOL                  bManualReset,
  BOOL                  bInitialState,
  LPCWSTR               lpName
);

https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-createeventw

2.WaitForSingleObject

DWORD WaitForSingleObject(
  HANDLE hHandle,
  DWORD  dwMilliseconds
);

https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitforsingleobject

3.SetEvent

BOOL SetEvent(
  HANDLE hEvent
);

https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-setevent

4.ResetEvent

BOOL ResetEvent(
  HANDLE hEvent
);

https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-resetevent

5.SetEventWhenCallbackReturns

void SetEventWhenCallbackReturns(
  PTP_CALLBACK_INSTANCE pci,
  HANDLE                evt
);

https://docs.microsoft.com/en-us/windows/win32/api/threadpoolapiset/nf-threadpoolapiset-seteventwhencallbackreturns