static std::atomic<int> databaseCounter;
-static SpinLock registrationLock = SPINLOCK_INITIALIZER;
+static StaticSpinLock registrationLock;
static std::atomic<int> didRegisterAtExit;
static Database* firstDatabase;
if (++didRegisterAtExit == 1)
atexit(atExitCallback);
- TCMalloc_SpinLockHolder holder(®istrationLock);
+ SpinLockHolder holder(registrationLock);
m_nextRegisteredDatabase = firstDatabase;
firstDatabase = this;
}
void Database::removeDatabaseFromAtExit()
{
- TCMalloc_SpinLockHolder holder(®istrationLock);
+ SpinLockHolder holder(registrationLock);
for (Database** current = &firstDatabase; *current; current = &(*current)->m_nextRegisteredDatabase) {
if (*current != this)
continue;
Database* Database::removeFirstAtExitDatabase()
{
- TCMalloc_SpinLockHolder holder(®istrationLock);
+ SpinLockHolder holder(registrationLock);
Database* result = firstDatabase;
if (result) {
firstDatabase = result->m_nextRegisteredDatabase;