summaryrefslogtreecommitdiff
path: root/cpp/demo/Freeze/customEvictor/CurrentDatabase.cpp
diff options
context:
space:
mode:
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;
}