Skip to content

Commit adaa2ae

Browse files
committed
src: add lock to inspector MainThreadHandle dtor
Otherwise, the `CHECK` is reported to be a race condition by automated tooling. It’s not easy to tell from looking at the source code whether that is actually the case or not, but adding this lock should be a safe way to resolve it. PR-URL: #26010 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 60c5099 commit adaa2ae

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/inspector/main_thread_interface.h

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class MainThreadHandle : public std::enable_shared_from_this<MainThreadHandle> {
4545
: main_thread_(main_thread) {
4646
}
4747
~MainThreadHandle() {
48+
Mutex::ScopedLock scoped_lock(block_lock_);
4849
CHECK_NULL(main_thread_); // main_thread_ should have called Reset
4950
}
5051
std::unique_ptr<InspectorSession> Connect(

0 commit comments

Comments
 (0)