summaryrefslogtreecommitdiff
path: root/indra/llcommon/llthread.h
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2012-02-07 13:11:39 -0500
committerNat Goodspeed <nat@lindenlab.com>2012-02-07 13:11:39 -0500
commit3bcd4f4608a7ce33b61c6978544096436dea4e53 (patch)
tree6ef7168a6ec646c023d2f4badc9a0960d20eea3e /indra/llcommon/llthread.h
parent33a42b32ca72031a79edca821966f6ebbdcddc93 (diff)
parent5e367f0d9de593c45683f7c640024a378bb03919 (diff)
Merge daggy fix at r32811ea374ab to tip
Diffstat (limited to 'indra/llcommon/llthread.h')
-rw-r--r--indra/llcommon/llthread.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index 40291a2569..b52e70ab2e 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -151,6 +151,7 @@ public:
void lock(); // blocks
void unlock();
bool isLocked(); // non-blocking, but does do a lock/unlock so not free
+ bool isSelfLocked(); //return true if locked in a same thread
U32 lockingThread() const; //get ID of locking thread
protected:
@@ -187,11 +188,14 @@ public:
LLMutexLock(LLMutex* mutex)
{
mMutex = mutex;
- mMutex->lock();
+
+ if(mMutex)
+ mMutex->lock();
}
~LLMutexLock()
{
- mMutex->unlock();
+ if(mMutex)
+ mMutex->unlock();
}
private:
LLMutex* mMutex;