diff --git a/src/square/ConsoleUI.cpp b/src/square/ConsoleUI.cpp index 61e737f24..793ca89e3 100644 --- a/src/square/ConsoleUI.cpp +++ b/src/square/ConsoleUI.cpp @@ -69,6 +69,8 @@ ConsoleUI::~ConsoleUI() void ConsoleUI::Print(std::tstring s) { + boost::mutex::scoped_lock lock(mutex); + tcout << "\n*******************************\n\n"; std::tcout << s; tcout << "\n*******************************\n" << endl; @@ -89,6 +91,8 @@ void ConsoleUI::Run() void ConsoleUI::PrintCommands() { + boost::mutex::scoped_lock lock(mutex); + tcout << "Commands:\n"; tcout << "\tp [file]: play file (enter full path)\n"; tcout << "\ts [n]: stop playing n-th file\n"; diff --git a/src/square/ConsoleUI.h b/src/square/ConsoleUI.h index 5d4d79d0c..52e3cf9f3 100644 --- a/src/square/ConsoleUI.h +++ b/src/square/ConsoleUI.h @@ -39,6 +39,8 @@ #include +#include + #include "Transport.h" #include "DummyAudioEventHandler.h" @@ -75,6 +77,8 @@ private: bool shouldQuit; private: Transport transport; private: DummyAudioEventHandler audioEventHandler; +private: boost::mutex mutex; + private: void ShutDown(); public: static DWORD WINAPI ThreadRun(LPVOID param); };