mirror of
https://github.com/clangen/musikcube.git
synced 2024-12-29 18:14:16 +00:00
Added mutex in ConsoleUI to lock while using cout. Makes debug output more readable.
This commit is contained in:
parent
afde4da532
commit
10d0ece3cb
@ -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";
|
||||
|
@ -39,6 +39,8 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <boost/thread/mutex.hpp>
|
||||
|
||||
#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);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user