summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/GCRecMutex.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2005-07-04 02:06:23 +0000
committerMichi Henning <michi@zeroc.com>2005-07-04 02:06:23 +0000
commit11440f12c77b43a7d43e948e15df35c4b71c7e00 (patch)
treea93bf57b23a16939e6e1c99f42b9263191247704 /cpp/src/Ice/GCRecMutex.cpp
parentMade Ice.ObjectImpl abstract. (diff)
downloadice-11440f12c77b43a7d43e948e15df35c4b71c7e00.tar.bz2
ice-11440f12c77b43a7d43e948e15df35c4b71c7e00.tar.xz
ice-11440f12c77b43a7d43e948e15df35c4b71c7e00.zip
Made Ice::Object abstract.
Diffstat (limited to 'cpp/src/Ice/GCRecMutex.cpp')
-rwxr-xr-xcpp/src/Ice/GCRecMutex.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/cpp/src/Ice/GCRecMutex.cpp b/cpp/src/Ice/GCRecMutex.cpp
new file mode 100755
index 00000000000..f4795d1daf4
--- /dev/null
+++ b/cpp/src/Ice/GCRecMutex.cpp
@@ -0,0 +1,51 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/GCRecMutex.h>
+
+namespace IceInternal
+{
+GCRecMutex gcRecMutex;
+}
+
+using namespace IceInternal;
+
+static int gcInitCount = 0;
+
+GCRecMutex::GCRecMutex()
+{
+ if(gcInitCount++ == 0)
+ {
+ _m = new IceUtil::RecMutex;
+ }
+}
+
+GCRecMutex::~GCRecMutex()
+{
+ if(--gcInitCount == 0)
+ {
+ delete _m;
+ }
+}
+
+GCRecMutexInit::GCRecMutexInit()
+{
+ if(gcInitCount++ == 0)
+ {
+ gcRecMutex._m = new IceUtil::RecMutex;
+ }
+}
+
+GCRecMutexInit::~GCRecMutexInit()
+{
+ if(--gcInitCount == 0)
+ {
+ delete gcRecMutex._m;
+ }
+}