summaryrefslogtreecommitdiff
path: root/cpp/demo/Database/Oracle/proc/CurrentSqlContext.pc
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/demo/Database/Oracle/proc/CurrentSqlContext.pc')
-rw-r--r--cpp/demo/Database/Oracle/proc/CurrentSqlContext.pc24
1 files changed, 23 insertions, 1 deletions
diff --git a/cpp/demo/Database/Oracle/proc/CurrentSqlContext.pc b/cpp/demo/Database/Oracle/proc/CurrentSqlContext.pc
index 35e27fc3749..4bac89163a7 100644
--- a/cpp/demo/Database/Oracle/proc/CurrentSqlContext.pc
+++ b/cpp/demo/Database/Oracle/proc/CurrentSqlContext.pc
@@ -86,11 +86,33 @@ private:
}
+namespace
+{
+IceUtil::Mutex* _globalMutex = 0;
+class Init
+{
+public:
+
+ Init()
+ {
+ _globalMutex = new IceUtil::Mutex();
+ }
+
+ ~Init()
+ {
+ delete _globalMutex;
+ _globalMutex = 0;
+ }
+};
+
+Init init;
+}
+
CurrentSqlContext::CurrentSqlContext(const string& connectInfo) :
_connectInfo(connectInfo)
{
{
- IceUtil::StaticMutex::Lock lock(IceUtil::globalMutex);
+ IceUtil::Mutex::Lock lock(*_globalMutex);
_index = _currentIndex++;
}
_hook = new Notification(_index);