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

Unified Diff: third_party/WebKit/Source/platform/heap/Handle.h

Issue 1974233002: Avoid race on uninitializing CrossThreadPersistent nodes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: symmetric acquire/release Created 4 years, 7 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 | « no previous file | third_party/WebKit/Source/platform/heap/PersistentNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/Handle.h
diff --git a/third_party/WebKit/Source/platform/heap/Handle.h b/third_party/WebKit/Source/platform/heap/Handle.h
index 69cb7575950ac9f977932624164767e83a43e6da..8036c3bf0b669910d93bd4e705cc389d7775ff38 100644
--- a/third_party/WebKit/Source/platform/heap/Handle.h
+++ b/third_party/WebKit/Source/platform/heap/Handle.h
@@ -240,13 +240,14 @@ private:
void uninitialize()
{
- if (!m_persistentNode)
- return;
-
if (crossThreadnessConfiguration == CrossThreadPersistentConfiguration) {
- ProcessHeap::crossThreadPersistentRegion().freePersistentNode(m_persistentNode);
+ if (acquireLoad(reinterpret_cast<void* volatile*>(&m_persistentNode)))
+ ProcessHeap::crossThreadPersistentRegion().freePersistentNode(m_persistentNode);
return;
}
+
+ if (!m_persistentNode)
+ return;
ThreadState* state = ThreadStateFor<ThreadingTrait<T>::Affinity>::state();
ASSERT(state->checkThread());
// Persistent handle must be created and destructed in the same thread.
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/PersistentNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698