summaryrefslogtreecommitdiff
path: root/cpp/demo/Freeze/customEvictor/CurrentDatabase.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2008-03-13 15:56:24 +0800
committerMatthew Newhook <matthew@zeroc.com>2008-03-13 15:56:24 +0800
commitca80b1da9e45035947e2f5f87cc257dafffc267a (patch)
tree4950ecce5a080851a7ccdeb64cb54cbe4d5c6cf0 /cpp/demo/Freeze/customEvictor/CurrentDatabase.cpp
parent- Revert prior fix for bug 2752. (diff)
downloadice-ca80b1da9e45035947e2f5f87cc257dafffc267a.tar.bz2
ice-ca80b1da9e45035947e2f5f87cc257dafffc267a.tar.xz
ice-ca80b1da9e45035947e2f5f87cc257dafffc267a.zip
get rid of some optimizer warnings.
Diffstat (limited to 'cpp/demo/Freeze/customEvictor/CurrentDatabase.cpp')
-rw-r--r--cpp/demo/Freeze/customEvictor/CurrentDatabase.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/cpp/demo/Freeze/customEvictor/CurrentDatabase.cpp b/cpp/demo/Freeze/customEvictor/CurrentDatabase.cpp
index ce841070525..b2c4cb31ecf 100644
--- a/cpp/demo/Freeze/customEvictor/CurrentDatabase.cpp
+++ b/cpp/demo/Freeze/customEvictor/CurrentDatabase.cpp
@@ -47,9 +47,13 @@ CurrentDatabase::CurrentDatabase(const Ice::CommunicatorPtr& comm, const string&
_dbName(dbName)
{
#ifdef USE_PTHREAD_KEY
+#ifdef NDEBUG
+ pthread_key_create(&dbKey, 0);
+#else
int rs = pthread_key_create(&dbKey, 0);
assert(rs == 0);
#endif
+#endif
}
CurrentDatabase::~CurrentDatabase()
@@ -75,9 +79,13 @@ CurrentDatabase::get()
Mutex::Lock sync(_dbListMutex);
_dbList.push_back(db);
#ifdef USE_PTHREAD_KEY
+#ifdef NDEBUG
+ pthread_setspecific(dbKey, db);
+#else
int rs = pthread_setspecific(dbKey, db);
assert(rs == 0);
#endif
+#endif
}
return *db;
}