mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-21 10:55:03 +00:00
core: Rewrite thread local storage implementation (#118)
This commit is contained in:
parent
b94efcba5a
commit
1b9bf924ca
11 changed files with 176 additions and 189 deletions
|
@ -175,28 +175,18 @@ public:
|
|||
using std::chrono::microseconds;
|
||||
using std::chrono::steady_clock;
|
||||
|
||||
const Entry entry = {
|
||||
.timestamp = duration_cast<microseconds>(steady_clock::now() - time_origin),
|
||||
.log_class = log_class,
|
||||
.log_level = log_level,
|
||||
.filename = filename,
|
||||
.line_num = line_num,
|
||||
.function = function,
|
||||
.message = std::move(message),
|
||||
};
|
||||
if (Config::getLogType() == "async") {
|
||||
|
||||
message_queue.EmplaceWait(Entry{
|
||||
.timestamp = duration_cast<microseconds>(steady_clock::now() - time_origin),
|
||||
.log_class = log_class,
|
||||
.log_level = log_level,
|
||||
.filename = filename,
|
||||
.line_num = line_num,
|
||||
.function = function,
|
||||
.message = std::move(message),
|
||||
});
|
||||
message_queue.EmplaceWait(entry);
|
||||
} else {
|
||||
|
||||
const Entry entry = {
|
||||
.timestamp = duration_cast<microseconds>(steady_clock::now() - time_origin),
|
||||
.log_class = log_class,
|
||||
.log_level = log_level,
|
||||
.filename = filename,
|
||||
.line_num = line_num,
|
||||
.function = function,
|
||||
.message = std::move(message),
|
||||
};
|
||||
ForEachBackend([&entry](auto& backend) { backend.Write(entry); });
|
||||
}
|
||||
}
|
||||
|
@ -239,7 +229,7 @@ private:
|
|||
}
|
||||
|
||||
void ForEachBackend(auto lambda) {
|
||||
lambda(debugger_backend);
|
||||
// lambda(debugger_backend);
|
||||
lambda(color_console_backend);
|
||||
lambda(file_backend);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue