mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-08 14:59:43 +01:00
fix(app): the log written to the end of the closing, each step of it with its time; the Discord thread idle outside the driver mode
The log service stopped with applicationQuitOrder, so whatever was logged while the simulator closed was lost; it now runs until StopLogService() and writes out what came before. The closing logs each of its steps with the time since it began, to tell where a closing that hangs stops. Outside the driver mode the Discord thread spun a core in its loop, it now sleeps a second between the checks.
This commit is contained in:
@@ -73,12 +73,21 @@ std::deque<std::string> ErrorStack;
|
||||
|
||||
// lock for log stacks
|
||||
std::mutex logMutex;
|
||||
// the log is written through the closing of the simulator, to the end
|
||||
std::atomic<bool> logStop{false};
|
||||
|
||||
void StopLogService()
|
||||
{
|
||||
logStop = true;
|
||||
}
|
||||
|
||||
|
||||
void LogService()
|
||||
{
|
||||
while (!Global.applicationQuitOrder)
|
||||
// one more pass after the stop, so what came just before it gets written too
|
||||
for (bool last{false}; false == last;)
|
||||
{
|
||||
last = logStop;
|
||||
{
|
||||
// --- Obsługa InfoStack ---
|
||||
while (!InfoStack.empty())
|
||||
|
||||
Reference in New Issue
Block a user