summaryrefslogtreecommitdiff
path: root/cpp/src/IceUtil/GC.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2003-10-22 03:59:45 +0000
committerMichi Henning <michi@zeroc.com>2003-10-22 03:59:45 +0000
commitb50195965683cd0381bcbf99ecb6f3d1dd934ead (patch)
tree8c690c117bf27402391d98031efe2512902b6af9 /cpp/src/IceUtil/GC.cpp
parentWin32 fixes (diff)
downloadice-b50195965683cd0381bcbf99ecb6f3d1dd934ead.tar.bz2
ice-b50195965683cd0381bcbf99ecb6f3d1dd934ead.tar.xz
ice-b50195965683cd0381bcbf99ecb6f3d1dd934ead.zip
Got rid of StaticRecMutex.
Diffstat (limited to 'cpp/src/IceUtil/GC.cpp')
-rw-r--r--cpp/src/IceUtil/GC.cpp42
1 files changed, 24 insertions, 18 deletions
diff --git a/cpp/src/IceUtil/GC.cpp b/cpp/src/IceUtil/GC.cpp
index 693da31a61c..9182bcecbcf 100644
--- a/cpp/src/IceUtil/GC.cpp
+++ b/cpp/src/IceUtil/GC.cpp
@@ -14,9 +14,31 @@
#include <IceUtil/GC.h>
#include <IceUtil/Time.h>
-#include <IceUtil/StaticRecMutex.h>
+#include <IceUtil/ObjectBase.h>
#include <map>
+
+namespace IceUtil
+{
+
+void
+recursivelyReachable(ObjectBase* p, ObjectSet& o)
+{
+ if(o.find(p) == o.end())
+ {
+ assert(p);
+ o.insert(p);
+ ObjectMultiSet tmp;
+ p->__gcReachable(tmp);
+ for(ObjectMultiSet::const_iterator i = tmp.begin(); i != tmp.end(); ++i)
+ {
+ recursivelyReachable(*i, o);
+ }
+ }
+}
+
+}
+
using namespace std;
int IceUtil::GC::_numCollectors = 0;
@@ -114,7 +136,7 @@ IceUtil::GC::collectGarbage()
GCStats stats;
- StaticRecMutex::Lock sync(gcMutex);
+ RecMutex::Lock sync(*gcRecMutex._m);
if(_statsCallback)
{
@@ -207,19 +229,3 @@ IceUtil::GC::collectGarbage()
_collecting = false;
}
}
-
-void
-IceUtil::GC::recursivelyReachable(ObjectBase* p, ObjectSet& o)
-{
- if(o.find(p) == o.end())
- {
- assert(p);
- o.insert(p);
- ObjectMultiSet tmp;
- p->__gcReachable(tmp);
- for(ObjectMultiSet::const_iterator i = tmp.begin(); i != tmp.end(); ++i)
- {
- recursivelyReachable(*i, o);
- }
- }
-}