mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-09 01:20:32 +01:00
Merge branch 'master' into feat/renderers-cleanup
This commit is contained in:
@@ -74,15 +74,28 @@ std::deque<std::string> ErrorStack;
|
||||
|
||||
// lock for log stacks
|
||||
std::mutex logMutex;
|
||||
namespace
|
||||
{
|
||||
// the log is written through the closing of the simulator, to the end: set once the closing has nothing more to tell
|
||||
std::atomic<bool> &log_stopped()
|
||||
{
|
||||
static std::atomic<bool> stopped{false};
|
||||
return stopped;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void StopLogService()
|
||||
{
|
||||
log_stopped() = true;
|
||||
}
|
||||
|
||||
|
||||
void LogService()
|
||||
{
|
||||
bool quitting{false};
|
||||
while (!quitting)
|
||||
// one more pass after the stop, so what came just before it gets written too
|
||||
for (bool last{false}; false == last;)
|
||||
{
|
||||
// read before the stacks are drained, so everything logged before the quit order still gets written
|
||||
quitting = Global.applicationQuitOrder;
|
||||
last = log_stopped();
|
||||
{
|
||||
// --- Obsługa InfoStack ---
|
||||
while (!InfoStack.empty())
|
||||
|
||||
Reference in New Issue
Block a user