summaryrefslogtreecommitdiff
path: root/rts/win32
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2020-04-19 17:29:58 +0200
committerBen Gamari <ben@smart-cactus.org>2020-07-15 16:41:02 -0400
commit1d197f4bbe5bf6d7189c329a742917db3f67ad34 (patch)
tree15bce49cc7bfa4707ae421e7acbcc46a851ceffa /rts/win32
parentbc79f9f180b3fc73fe25439faf9cc5f19622acb3 (diff)
downloadhaskell-1d197f4bbe5bf6d7189c329a742917db3f67ad34.tar.gz
winio: Mark outstanding_service_requests volatile.
As far as I know C(99) gives no guarantees for code like bool condition; ... while(condition) sleep(); that condition will be updated if it's changed by another thread. So we are explicit here and mark it as volatile, this will force a reload from memory on each iteration.
Diffstat (limited to 'rts/win32')
-rw-r--r--rts/win32/AsyncWinIO.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/rts/win32/AsyncWinIO.c b/rts/win32/AsyncWinIO.c
index 1122f2760c..1a4c6414ce 100644
--- a/rts/win32/AsyncWinIO.c
+++ b/rts/win32/AsyncWinIO.c
@@ -134,8 +134,14 @@ uint64_t outstanding_requests = 0;
/* Boolean controlling if the I/O manager is/should still be running. */
bool running = false;
/* Boolean to indicate whether we have outstanding I/O requests that still need
- to be processed by the I/O manager on the Haskell side. */
-bool outstanding_service_requests = false;
+ to be processed by the I/O manager on the Haskell side.
+ Set by:
+ notifyRtsOfFinishedCall (true)
+ servicedIOEntries (false)
+ Read by:
+ runner
+ */
+volatile bool outstanding_service_requests = false;
/* Indicates wether we have hit one case where we serviced as much requests as
we could because the buffer got full. In such cases for the next requests
we expand the buffers so we have room to process requests in bigger