Added mutex guards around logging

This commit is contained in:
Mark Vejvoda
2010-05-01 09:10:52 +00:00
parent a911088d39
commit e379905942
7 changed files with 56 additions and 30 deletions

View File

@@ -15,8 +15,10 @@
#include <string>
#include <fstream>
#include <map>
#include "thread.h"
using std::string;
using namespace Shared::Platform;
namespace Shared{ namespace Util{
@@ -35,7 +37,7 @@ public:
{
protected:
DebugType debugType;
public:
SystemFlagsType() {
this->debugType = debugSystem;
@@ -43,6 +45,7 @@ public:
this->fileStream = NULL;
this->debugLogFileName = "";
this->fileStreamOwner = false;
this->mutex = NULL;
}
SystemFlagsType(DebugType debugType) {
this->debugType = debugType;
@@ -50,6 +53,7 @@ public:
this->fileStream = NULL;
this->debugLogFileName = "";
this->fileStreamOwner = false;
this->mutex = NULL;
}
SystemFlagsType(DebugType debugType,bool enabled,
std::ofstream *fileStream,std::string debugLogFileName) {
@@ -58,12 +62,14 @@ public:
this->fileStream = fileStream;
this->debugLogFileName = debugLogFileName;
this->fileStreamOwner = false;
this->mutex = mutex;
}
bool enabled;
std::ofstream *fileStream;
std::string debugLogFileName;
bool fileStreamOwner;
Mutex *mutex;
};
protected: