-
Notifications
You must be signed in to change notification settings - Fork 264
Closed
Description
[[nodiscard]] inline auto resume_foreground(
Windows::System::DispatcherQueue const& dispatcher,
Windows::System::DispatcherQueuePriority const priority = Windows::System::DispatcherQueuePriority::Normal) noexcept
{
struct awaitable
{
...
bool await_suspend(std::experimental::coroutine_handle<> handle)
{
m_queued = m_dispatcher.TryEnqueue(m_priority, [handle]
{
handle();
});
return m_queued;
}There is a race condition here: If TryEnqueue succeeds, the coroutine may resume before TryEnqueue returns. In that case, the coroutine has been destructed, and our attempt to use m_queued will AV.
Unit tests randomly fail on my machine due to this bug.
Metadata
Metadata
Assignees
Labels
No labels