summaryrefslogtreecommitdiff
path: root/indra/llcommon/llinstancetracker.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-10-01 14:28:39 -0700
committerRichard Linden <none@none>2013-10-01 14:28:39 -0700
commit59628d6f85deed89cb35d9343183069cfccd13c0 (patch)
tree6b4c35053c2291fd5ff1cccedf86bbd76ce78e1d /indra/llcommon/llinstancetracker.cpp
parentad777b46d0fe5d790e43efb1771e9f64f3ad3dfb (diff)
parent9e486f6c6abbee6cb41ba9a6271d8a025ad924ef (diff)
Automated merge with http://bitbucket.org/lindenlab/viewer-release
Diffstat (limited to 'indra/llcommon/llinstancetracker.cpp')
-rwxr-xr-xindra/llcommon/llinstancetracker.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/indra/llcommon/llinstancetracker.cpp b/indra/llcommon/llinstancetracker.cpp
index 5dc3ea5d7b..7ff8324fe3 100755
--- a/indra/llcommon/llinstancetracker.cpp
+++ b/indra/llcommon/llinstancetracker.cpp
@@ -27,23 +27,25 @@
#include "linden_common.h"
// associated header
#include "llinstancetracker.h"
+#include "llapr.h"
+
// STL headers
// std headers
// external library headers
// other Linden headers
-//static
-void * & LLInstanceTrackerBase::getInstances(std::type_info const & info)
+void LLInstanceTrackerBase::StaticBase::incrementDepth()
+{
+ apr_atomic_inc32(&sIterationNestDepth);
+}
+
+void LLInstanceTrackerBase::StaticBase::decrementDepth()
{
- typedef std::map<std::string, void *> InstancesMap;
- static InstancesMap instances;
+ apr_atomic_dec32(&sIterationNestDepth);
+}
- // std::map::insert() is just what we want here. You attempt to insert a
- // (key, value) pair. If the specified key doesn't yet exist, it inserts
- // the pair and returns a std::pair of (iterator, true). If the specified
- // key DOES exist, insert() simply returns (iterator, false). One lookup
- // handles both cases.
- return instances.insert(InstancesMap::value_type(info.name(),
- InstancesMap::mapped_type()))
- .first->second;
+U32 LLInstanceTrackerBase::StaticBase::getDepth()
+{
+ apr_uint32_t data = apr_atomic_read32(&sIterationNestDepth);
+ return data;
}