/* ------------------------------------------------------------------------------------------------ * Flush queued messages to the console output. */ void FlushMessages() { // Acquire a global lock std::lock_guard< std::mutex > lock(g_Mutex); // Output any queued messages while (!g_Messages.empty()) { // Identify the message type and send it if (g_Messages.front().second) { OutputMessage("%s", g_Messages.front().first.c_str()); } else { OutputError("%s", g_Messages.front().first.c_str()); } // Pop the message from the queue g_Messages.pop(); } }