diff options
| author | Richard Linden <none@none> | 2012-12-23 12:27:25 -0800 |
|---|---|---|
| committer | Richard Linden <none@none> | 2012-12-23 12:27:25 -0800 |
| commit | 3fd640a6e3dea7a3551c239323d782fb082e1dbd (patch) | |
| tree | 2e0736320792e74d10570087982fb13938315d52 /indra/llcommon/llinstancetracker.cpp | |
| parent | 013f04cabec8e110ee659d9b3f75a4d25f114b7b (diff) | |
SH-3468 WIP add memory tracking base class
fixed crash on exit by making LLInstanceTracker iterators use atomic iterator
nesting count for thread safety
Diffstat (limited to 'indra/llcommon/llinstancetracker.cpp')
| -rw-r--r-- | indra/llcommon/llinstancetracker.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp index 5dc3ea5d7b..071a637cda 100644 --- a/indra/llcommon/llinstancetracker.cpp +++ b/indra/llcommon/llinstancetracker.cpp @@ -27,6 +27,8 @@ #include "linden_common.h" // associated header #include "llinstancetracker.h" +#include "llapr.h" + // STL headers // std headers // external library headers @@ -47,3 +49,19 @@ void * & LLInstanceTrackerBase::getInstances(std::type_info const & info) InstancesMap::mapped_type())) .first->second; } + +void LLInstanceTrackerBase::StaticBase::incrementDepth() +{ + apr_atomic_inc32(&sIterationNestDepth); +} + +void LLInstanceTrackerBase::StaticBase::decrementDepth() +{ + apr_atomic_dec32(&sIterationNestDepth); +} + +U32 LLInstanceTrackerBase::StaticBase::getDepth() +{ + apr_uint32_t data = apr_atomic_read32(&sIterationNestDepth); + return data; +} |
