- atempt to cleanup use fo auto_ptr

This commit is contained in:
SoftCoder
2016-01-18 13:20:49 -08:00
parent d82aaa22ad
commit 86a59859b9
16 changed files with 76 additions and 50 deletions

View File

@@ -18,7 +18,6 @@
#include "platform_common.h"
#include "base_thread.h"
#include "time.h"
#include <memory>
using namespace std;
@@ -28,15 +27,15 @@ bool Thread::enableVerboseMode = false;
Mutex Thread::mutexthreadList;
vector<Thread *> Thread::threadList;
auto_ptr<Mutex> Mutex::mutexMutexList(new Mutex(CODE_AT_LINE));
unique_ptr<Mutex> Mutex::mutexMutexList(new Mutex(CODE_AT_LINE));
vector<Mutex *> Mutex::mutexList;
class ThreadGarbageCollector;
class Mutex;
class MutexSafeWrapper;
static auto_ptr<ThreadGarbageCollector> cleanupThread;
static auto_ptr<Mutex> cleanupThreadMutex(new Mutex(CODE_AT_LINE));
static unique_ptr<ThreadGarbageCollector> cleanupThread;
static unique_ptr<Mutex> cleanupThreadMutex(new Mutex(CODE_AT_LINE));
class ThreadGarbageCollector : public BaseThread
{
@@ -547,7 +546,7 @@ inline void Mutex::p() {
// snprintf(szBuf,8095,"In [%s::%s Line: %d] mutex == NULL refCount = %d owner [%s] deleteownerId [%s] stack: %s",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,refCount,ownerId.c_str(),deleteownerId.c_str(),stack.c_str());
// throw megaglest_runtime_error(szBuf);
// }
// std::auto_ptr<Chrono> chronoLockPerf;
// std::unique_ptr<Chrono> chronoLockPerf;
// if(debugMutexLock == true) {
// chronoLockPerf.reset(new Chrono());
// chronoLockPerf->start();