summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-05-21 11:53:35 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-05-27 00:14:33 -0400
commit04750304deae2128a8350e28224e1f62ae949820 (patch)
tree2b2f402defb7aa7ede3a75dc05b724b32adc381f /docs
parentede241268171e8eee1e750d88ff356ddbfc357f2 (diff)
downloadhaskell-04750304deae2128a8350e28224e1f62ae949820.tar.gz
eventlog: Fix racy flushing
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')
-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``.