summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2020-06-01 06:00:56 +0100
committerBen Gamari <ben@smart-cactus.org>2020-07-15 16:41:03 -0400
commit6be6bcbac0e39537f3a40c615d1568a3d6391f9b (patch)
tree00ab5b6d76153dee0dbc0211959622139f7d5cc5 /rts
parent3ebd8ad9b1f7f77a928f2ff0d3e61ddfae068dd3 (diff)
downloadhaskell-6be6bcbac0e39537f3a40c615d1568a3d6391f9b.tar.gz
winio: Fix rebase artifacts
Diffstat (limited to 'rts')
-rw-r--r--rts/win32/AsyncWinIO.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/rts/win32/AsyncWinIO.c b/rts/win32/AsyncWinIO.c
index 70b4455c71..b625dcaf0a 100644
--- a/rts/win32/AsyncWinIO.c
+++ b/rts/win32/AsyncWinIO.c
@@ -387,25 +387,18 @@ void registerAlertableWait (bool has_timeout, DWORD mssec, uint64_t num_req, boo
finished overlapped entried belonging to the completed I/O requests. The
number of read entries will be returned in NUM.
- We clear the outstanding request flag to prevent two threads from handling
- the same payload early on. Failing this the final safe guard is in
- processCompletions. */
+ NOTE: This function isn't thread safe, but is intended to be called only
+ when requested by the I/O manager via notifyScheduler. In
+ that context it is thread safe as we're guaranteeing that the I/O
+ manager is blocked waiting for the read to happen followed by a
+ registerAlertableWait call. */
OVERLAPPED_ENTRY* getOverlappedEntries (uint32_t *num)
{
- AcquireSRWLockExclusive (&lock);
-
- if (outstanding_service_requests)
- *num = num_last_completed;
- else
- *num = 0;
-
- outstanding_service_requests = false;
-
- ReleaseSRWLockExclusive (&lock);
-
+ *num = num_last_completed;
return entries;
}
+
/* Called by the scheduler when we have ran out of work to do and we have at
least one thread blocked on an I/O Port. When WAIT then if this function
returns you will have at least one action to service, though this may be a