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

Unified Diff: third_party/WebKit/Source/platform/heap/PersistentNode.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 | « third_party/WebKit/Source/platform/heap/Handle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/PersistentNode.h
diff --git a/third_party/WebKit/Source/platform/heap/PersistentNode.h b/third_party/WebKit/Source/platform/heap/PersistentNode.h
index 4775fd5f4ef8ad92a04c9a3a9b14fc1ef4629702..2478a1d7abef5baa2833b6fe8f128a6f07dd5735 100644
--- a/third_party/WebKit/Source/platform/heap/PersistentNode.h
+++ b/third_party/WebKit/Source/platform/heap/PersistentNode.h
@@ -177,7 +177,8 @@ public:
void allocatePersistentNode(PersistentNode*& persistentNode, void* self, TraceCallback trace)
{
MutexLocker lock(m_mutex);
- persistentNode = m_persistentRegion->allocatePersistentNode(self, trace);
+ PersistentNode* node = m_persistentRegion->allocatePersistentNode(self, trace);
+ releaseStore(reinterpret_cast<void* volatile*>(&persistentNode), node);
}
void freePersistentNode(PersistentNode*& persistentNode)
@@ -193,7 +194,7 @@ public:
if (!persistentNode)
return;
m_persistentRegion->freePersistentNode(persistentNode);
- persistentNode = nullptr;
+ releaseStore(reinterpret_cast<void* volatile*>(&persistentNode), nullptr);
}
void tracePersistentNodes(Visitor* visitor)
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Handle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698