mirror of
https://github.com/aristocratos/btop.git
synced 2024-06-02 02:24:54 +12:00
Synchronize thread access with a mutex instead of atomic<bool>
This commit is contained in:
parent
3c92f2b912
commit
e04cbcde8a
|
@ -18,7 +18,7 @@ namespace fs = std::filesystem;
|
|||
|
||||
namespace Logger {
|
||||
using namespace Tools;
|
||||
std::atomic<bool> busy(false);
|
||||
std::mutex log_mtx {};
|
||||
bool first = true;
|
||||
const string tdf = "%Y/%m/%d (%T) | ";
|
||||
|
||||
|
@ -48,7 +48,7 @@ namespace Logger {
|
|||
if (loglevel < level or logfile.empty()) {
|
||||
return;
|
||||
}
|
||||
atomic_lock lck(busy, true);
|
||||
std::lock_guard lock {log_mtx};
|
||||
lose_priv neutered{};
|
||||
std::error_code ec;
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue