Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Unified Diff: Source/wtf/Partitions.cpp

Issue 1288773004: Merge 198825 "PartitionAlloc: Add a lock to Partitions::initiali..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2454/
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/wtf/Partitions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/Partitions.cpp
===================================================================
--- Source/wtf/Partitions.cpp (revision 200472)
+++ Source/wtf/Partitions.cpp (working copy)
@@ -37,7 +37,8 @@
namespace WTF {
-bool Partitions::s_initialized;
+int Partitions::s_initializationLock = 0;
+bool Partitions::s_initialized = false;
PartitionAllocatorGeneric Partitions::m_fastMallocAllocator;
PartitionAllocatorGeneric Partitions::m_bufferAllocator;
@@ -47,6 +48,8 @@
void Partitions::initialize()
{
+ spinLockLock(&s_initializationLock);
+
if (!s_initialized) {
m_fastMallocAllocator.init();
m_bufferAllocator.init();
@@ -54,6 +57,8 @@
m_layoutAllocator.init();
s_initialized = true;
}
+
+ spinLockUnlock(&s_initializationLock);
}
void Partitions::setHistogramEnumeration(HistogramEnumerationFunction histogramEnumeration)
« no previous file with comments | « Source/wtf/Partitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698