X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/81345200c95645a1b0d2635520f96ad55dfde63f..refs/heads/master:/profiler/ProfilerDatabase.cpp?ds=inline diff --git a/profiler/ProfilerDatabase.cpp b/profiler/ProfilerDatabase.cpp index 3d5a2ee..236a5c8 100644 --- a/profiler/ProfilerDatabase.cpp +++ b/profiler/ProfilerDatabase.cpp @@ -35,7 +35,7 @@ namespace JSC { namespace Profiler { static std::atomic databaseCounter; -static SpinLock registrationLock = SPINLOCK_INITIALIZER; +static StaticSpinLock registrationLock; static std::atomic didRegisterAtExit; static Database* firstDatabase; @@ -138,14 +138,14 @@ void Database::addDatabaseToAtExit() 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; @@ -163,7 +163,7 @@ void Database::performAtExitSave() const Database* Database::removeFirstAtExitDatabase() { - TCMalloc_SpinLockHolder holder(®istrationLock); + SpinLockHolder holder(registrationLock); Database* result = firstDatabase; if (result) { firstDatabase = result->m_nextRegisteredDatabase;