mirror of
https://github.com/catchorg/Catch2.git
synced 2025-12-03 09:49:32 +01:00
Initialize ReusableStringStream cache before user threads can run
The initialization itself is thread unsafe, and as such we cannot allow it to be delayed until multiple user-spawned threads need it.
This commit is contained in:
@@ -210,6 +210,13 @@ namespace Catch {
|
|||||||
{
|
{
|
||||||
getCurrentMutableContext().setResultCapture( this );
|
getCurrentMutableContext().setResultCapture( this );
|
||||||
m_reporter->testRunStarting(m_runInfo);
|
m_reporter->testRunStarting(m_runInfo);
|
||||||
|
|
||||||
|
// TODO: HACK!
|
||||||
|
// We need to make sure the underlying cache is initialized
|
||||||
|
// while we are guaranteed to be running in a single thread,
|
||||||
|
// because the initialization is not thread-safe.
|
||||||
|
ReusableStringStream rss;
|
||||||
|
(void)rss;
|
||||||
}
|
}
|
||||||
|
|
||||||
RunContext::~RunContext() {
|
RunContext::~RunContext() {
|
||||||
|
|||||||
Reference in New Issue
Block a user