diff options
| author | Martin Hořeňovský | 2025-08-23 00:15:53 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2025-08-23 11:08:18 +0200 |
| commit | 582200a1f8ddd6f435d1264668c7074121c2636c (patch) | |
| tree | 06629812ca77ebbd77a35424162e197bb979d85e /src/catch2/catch_message.cpp | |
| parent | f4e05a67bb5a57ee6e051fc8c391b32cbf927f7d (diff) | |
| download | catch3-582200a1f8ddd6f435d1264668c7074121c2636c.tar.gz | |
Make message macros (FAIL, WARN, INFO, etc) thread safe
This builds on the existing work to make assertion thread safe,
by adding an extra synchronization point in the holder of
`ReusableStringStream`'s stream instances, as those are used to
build the messages, and finishing the move of message scope holders
to be thread-local.
Diffstat (limited to 'src/catch2/catch_message.cpp')
| -rw-r--r-- | src/catch2/catch_message.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/catch2/catch_message.cpp b/src/catch2/catch_message.cpp index d3914a80..9cb0167f 100644 --- a/src/catch2/catch_message.cpp +++ b/src/catch2/catch_message.cpp @@ -101,8 +101,9 @@ namespace Catch { } Capturer::~Capturer() { assert( m_captured == m_messages.size() ); - for ( size_t i = 0; i < m_captured; ++i ) + for ( size_t i = 0; i < m_captured; ++i ) { m_resultCapture.popScopedMessage( m_messages[i] ); + } } void Capturer::captureValue( size_t index, std::string const& value ) { |