Commit e51ab6e2 authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

[heap] LocalHeap::IsParked doesn't need mutex

We only use IsParked from the thread that owns the LocalHeap, which is
the only thread which mutates state_. So it is safe to read state_ from
that thread without a mutex.

Bug: v8:10315
Change-Id: I3725ca4c4c4da1c661d7b4f06d295312914b4b52
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2332168Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69172}
parent 2d7f3d5b
......@@ -81,7 +81,7 @@ bool LocalHeap::IsHandleDereferenceAllowed() {
#endif
bool LocalHeap::IsParked() {
base::MutexGuard guard(&state_mutex_);
DCHECK_EQ(LocalHeap::Current(), this);
return state_ == ThreadState::Parked;
}
......
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