fixup
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user