Commit 8432c46a authored by Andrew Comminos's avatar Andrew Comminos Committed by Commit Bot

[cpu-profiler] Protect StringsStorage::GetCopy with a lock

Ensure that we don't concurrently modify the StringsStorage map when
getting a copy of a string.

Bug: v8:11054
Change-Id: I6ad61838d7c5e8a6e9ff21aac04da8d353e41ad5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2648821Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Andrew Comminos <acomminos@fb.com>
Cr-Commit-Position: refs/heads/master@{#72416}
parent dfcf1e86
......@@ -27,6 +27,7 @@ StringsStorage::~StringsStorage() {
}
const char* StringsStorage::GetCopy(const char* src) {
base::MutexGuard guard(&mutex_);
int len = static_cast<int>(strlen(src));
base::HashMap::Entry* entry = GetEntry(src, len);
if (entry->value == nullptr) {
......
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