diff options
author | Michi Henning <michi@zeroc.com> | 2005-07-04 02:06:23 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2005-07-04 02:06:23 +0000 |
commit | 11440f12c77b43a7d43e948e15df35c4b71c7e00 (patch) | |
tree | a93bf57b23a16939e6e1c99f42b9263191247704 /cpp/src/Ice/GCRecMutex.cpp | |
parent | Made Ice.ObjectImpl abstract. (diff) | |
download | ice-11440f12c77b43a7d43e948e15df35c4b71c7e00.tar.bz2 ice-11440f12c77b43a7d43e948e15df35c4b71c7e00.tar.xz ice-11440f12c77b43a7d43e948e15df35c4b71c7e00.zip |
Made Ice::Object abstract.
Diffstat (limited to 'cpp/src/Ice/GCRecMutex.cpp')
-rwxr-xr-x | cpp/src/Ice/GCRecMutex.cpp | 51 |
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; + } +} |