Commit d58c402f authored by jl@opera.com's avatar jl@opera.com

Don't set WTF::Partitions::s_initialized to true before initializing

In theory, a simultaneous caller to Partitions::getBufferPartition()
could see the flag as being true, and return the uninitialized buffer
partition, while another thread is initializing it.

BUG=367672

Review URL: https://codereview.chromium.org/268673012

git-svn-id: svn://svn.chromium.org/blink/trunk@175020 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 85cda4f0
...@@ -79,8 +79,8 @@ void Partitions::initialize() ...@@ -79,8 +79,8 @@ void Partitions::initialize()
// Guard against two threads hitting here in parallel. // Guard against two threads hitting here in parallel.
spinLockLock(&lock); spinLockLock(&lock);
if (!s_initialized) { if (!s_initialized) {
s_initialized = true;
m_bufferAllocator.init(); m_bufferAllocator.init();
s_initialized = true;
} }
spinLockUnlock(&lock); spinLockUnlock(&lock);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment