add LockMutex::Unlock

This commit is contained in:
Glenn Maynard
2002-12-27 22:11:55 +00:00
parent 0c55e8d4bc
commit 0698b2580d
2 changed files with 17 additions and 1 deletions
+12 -1
View File
@@ -79,11 +79,13 @@ LockMutex::LockMutex(RageMutex &mut, const char *file_, int line_):
locked_at(RageTimer::GetTimeSinceStart())
{
mutex.Lock();
locked = true;
}
LockMutex::~LockMutex()
{
mutex.Unlock();
if(locked)
mutex.Unlock();
if(file)
{
@@ -93,6 +95,15 @@ LockMutex::~LockMutex()
}
}
void LockMutex::Unlock()
{
ASSERT(locked);
locked = false;
mutex.Unlock();
}
/*
-----------------------------------------------------------------------------
File: RageThreads