2222
2323namespace coro {
2424
25+ #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_GAMES)
26+
2527/* *
2628 * @brief Awaitable event type over Win32 thread pool
2729 * @ingroup Windows
@@ -50,15 +52,20 @@ class set_or_cancel final {
5052 private:
5153 /* *
5254 * @brief Resume the coroutine in the thread pool to wait for the event object
55+ * @note It uses `INFINITE`, `WT_EXECUTEONLYONCE` for `RegisterWaitForSingleObject`
56+ *
5357 * @see https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-registerwaitforsingleobject
58+ *
5459 * @todo can we use `WT_EXECUTEINWAITTHREAD` for this type?
5560 */
5661 void suspend (coroutine_handle<void >) noexcept (false );
5762
5863 public:
5964 /* *
60- * @brief cancel the event waiting
61- * @return uint32_t
65+ * @brief cancel the event waiting
66+ * @note `ERROR_IO_PENDING` will return `NO_ERROR` because it is using `INFINITE` timeout.
67+ * @return uint32_t `GetLastError` after `UnregisterWait`
68+ *
6269 * @see https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-unregisterwait
6370 */
6471 uint32_t unregister () noexcept ;
@@ -73,10 +80,12 @@ class set_or_cancel final {
7380 return unregister ();
7481 }
7582};
83+ #endif // WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_GAMES
7684
7785/* *
7886 * @brief Move into the win32 thread pool and continue the routine
7987 * @ingroup Windows
88+ *
8089 * @see CreateThreadpoolWork
8190 * @see SubmitThreadpoolWork
8291 * @see CloseThreadpoolWork
@@ -117,6 +126,7 @@ class continue_on_thread_pool final {
117126/* *
118127 * @brief Move into the designated thread's APC queue and continue the routine
119128 * @ingroup Windows
129+ *
120130 * @see QueueUserAPC
121131 * @see OpenThread
122132 */
0 commit comments