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: https://github.com/nodejs/node/pull/26010 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
93417ac995
commit
82c4e170e5
@ -45,6 +45,7 @@ class MainThreadHandle : public std::enable_shared_from_this<MainThreadHandle> {
|
|||||||
: main_thread_(main_thread) {
|
: main_thread_(main_thread) {
|
||||||
}
|
}
|
||||||
~MainThreadHandle() {
|
~MainThreadHandle() {
|
||||||
|
Mutex::ScopedLock scoped_lock(block_lock_);
|
||||||
CHECK_NULL(main_thread_); // main_thread_ should have called Reset
|
CHECK_NULL(main_thread_); // main_thread_ should have called Reset
|
||||||
}
|
}
|
||||||
std::unique_ptr<InspectorSession> Connect(
|
std::unique_ptr<InspectorSession> Connect(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user