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

@@ -19,8 +19,7 @@ using namespace Shared::Util;
namespace Shared { namespace PlatformCommon {
BaseThread::BaseThread() {
BaseThread::BaseThread() : Thread() {
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
setQuitStatus(false);
@@ -88,7 +87,7 @@ void BaseThread::setRunningStatus(bool value) {
}
void BaseThread::shutdownAndWait(BaseThread *pThread) {
if(pThread != NULL) {
if(pThread != NULL && pThread->getRunningStatus() == true) {
pThread->signalQuit();
for( time_t elapsed = time(NULL); difftime(time(NULL),elapsed) <= 10; ) {
if(pThread->getRunningStatus() == false) {