mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-19 18:15:50 +00:00
Compare commits
2 Commits
test-cron-
...
nd-allow-m
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af1920b8c3 | ||
|
|
b11397e4df |
@@ -19,9 +19,9 @@
|
|||||||
|
|
||||||
#ifndef TEST_UNIT_TEST_SUITE_JOURNAL_H
|
#ifndef TEST_UNIT_TEST_SUITE_JOURNAL_H
|
||||||
#define TEST_UNIT_TEST_SUITE_JOURNAL_H
|
#define TEST_UNIT_TEST_SUITE_JOURNAL_H
|
||||||
|
|
||||||
#include <ripple/beast/unit_test.h>
|
#include <ripple/beast/unit_test.h>
|
||||||
#include <ripple/beast/utility/Journal.h>
|
#include <ripple/beast/utility/Journal.h>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
namespace test {
|
namespace test {
|
||||||
@@ -82,7 +82,13 @@ SuiteJournalSink::write(
|
|||||||
|
|
||||||
// Only write the string if the level at least equals the threshold.
|
// Only write the string if the level at least equals the threshold.
|
||||||
if (level >= threshold())
|
if (level >= threshold())
|
||||||
|
{
|
||||||
|
// std::endl flushes → sync() → str()/str("") race in shared buffer →
|
||||||
|
// crashes
|
||||||
|
static std::mutex log_mutex;
|
||||||
|
std::lock_guard lock(log_mutex);
|
||||||
suite_.log << s << partition_ << text << std::endl;
|
suite_.log << s << partition_ << text << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class SuiteJournal
|
class SuiteJournal
|
||||||
|
|||||||
Reference in New Issue
Block a user