Reset state of event before executing overlap code

This commit is contained in:
Gliniak 2022-02-06 12:29:07 +01:00
parent 5784e7bc8d
commit 4bfd3a6506
1 changed files with 8 additions and 0 deletions

View File

@ -813,6 +813,14 @@ void KernelState::CompleteOverlappedDeferredEx(
auto ptr = memory()->TranslateVirtual(overlapped_ptr);
XOverlappedSetResult(ptr, X_ERROR_IO_PENDING);
XOverlappedSetContext(ptr, XThread::GetCurrentThreadHandle());
X_HANDLE event_handle = XOverlappedGetEvent(ptr);
if (event_handle) {
auto ev = object_table()->LookupObject<XEvent>(event_handle);
assert_not_null(ev);
if (ev) {
ev->Reset();
}
}
auto global_lock = global_critical_region_.Acquire();
dispatch_queue_.push_back([this, completion_callback, overlapped_ptr,
pre_callback, post_callback]() {