summaryrefslogtreecommitdiff
path: root/docs/users_guide
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-05-21 11:53:35 -0400
committerBen Gamari <ben@smart-cactus.org>2020-05-25 14:00:58 -0400
commited97b68edf9396c1355d012dc510d340f3489383 (patch)
treedc63f44fe9826de082ae572281d1eab27f68a68b /docs/users_guide
parent566cc73f46d67e2b36fda95d0253067bb0ecc12f (diff)
downloadhaskell-wip/T18210.tar.gz
eventlog: Fix racy flushingwip/T18210
Previously no attempt was made to avoid multiple threads writing their capability-local eventlog buffers to the eventlog writer simultaneously. This could result in multiple eventlog streams being interleaved. Fix this by documenting that the EventLogWriter's write() and flush() functions may be called reentrantly and fix the default writer to protect its FILE* by a mutex. Fixes #18210.
Diffstat (limited to 'docs/users_guide')
-rw-r--r--docs/users_guide/runtime_control.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/users_guide/runtime_control.rst b/docs/users_guide/runtime_control.rst
index 6d60eb507e..931710d06f 100644
--- a/docs/users_guide/runtime_control.rst
+++ b/docs/users_guide/runtime_control.rst
@@ -196,11 +196,17 @@ Furthermore GHC lets you specify the way event log data (see :rts-flag:`-l
Hands buffered event log data to your event log writer. Return true on success.
Required for a custom :c:type:`EventLogWriter`.
+ Note that this function may be called by multiple threads
+ simultaneously.
+
.. c:member:: void flushEventLog(void)
Flush buffers (if any) of your custom :c:type:`EventLogWriter`. This can
be ``NULL``.
+ Note that this function may be called by multiple threads
+ simultaneously.
+
.. c:member:: void stopEventLogWriter(void)
Called when event logging is about to stop. This can be ``NULL``.