mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-11-16 15:57:39 +00:00
Fixed race condition when using --no-color
This commit is contained in:
parent
2071a24a9f
commit
88f346414a
1 changed files with 5 additions and 2 deletions
|
@ -160,7 +160,10 @@ private:
|
|||
p += 3;
|
||||
size -= 3;
|
||||
|
||||
if (!CONSOLE_COLORS) {
|
||||
// Read CONSOLE_COLORS only once because its value can be changed in another thread
|
||||
const bool c = CONSOLE_COLORS;
|
||||
|
||||
if (!c) {
|
||||
strip_colors(p, size);
|
||||
}
|
||||
|
||||
|
@ -181,7 +184,7 @@ private:
|
|||
}
|
||||
|
||||
if (m_logFile.is_open()) {
|
||||
if (CONSOLE_COLORS) {
|
||||
if (c) {
|
||||
strip_colors(p, size);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue