This commit is contained in:
Glenn Maynard
2002-12-27 23:01:45 +00:00
parent 4e9dd2686d
commit c0a132cb18
2 changed files with 9 additions and 9 deletions
+7 -7
View File
@@ -86,13 +86,6 @@ LockMutex::~LockMutex()
{
if(locked)
mutex.Unlock();
if(file)
{
float dur = RageTimer::GetTimeSinceStart() - locked_at;
if(dur > 0.015)
LOG->Trace(ssprintf("Lock at %s:%i took %f", file, line, dur));
}
}
void LockMutex::Unlock()
@@ -101,6 +94,13 @@ void LockMutex::Unlock()
locked = false;
mutex.Unlock();
if(file && locked_at != -1)
{
float dur = RageTimer::GetTimeSinceStart() - locked_at;
if(dur > 0.015)
LOG->Trace(ssprintf("Lock at %s:%i took %f", file, line, dur));
}
}
+2 -2
View File
@@ -34,9 +34,9 @@ class LockMutex
public:
LockMutex(RageMutex &mut, const char *file, int line);
LockMutex(RageMutex &mut): mutex(mut), file(NULL), line(-1), locked_at(0) { mutex.Lock(); }
LockMutex(RageMutex &mut): mutex(mut), file(NULL), line(-1), locked_at(-1), locked(true) { mutex.Lock(); }
~LockMutex();
LockMutex(LockMutex &cpy): mutex(cpy.mutex), file(cpy.file), line(cpy.line), locked_at(cpy.locked_at) { mutex.Lock(); }
LockMutex(LockMutex &cpy): mutex(cpy.mutex), file(NULL), line(-1), locked_at(cpy.locked_at), locked(true) { mutex.Lock(); }
/* Unlock the mutex (before this would normally go out of scope). This can
* only be called once. */