Skip to content
Merged
Prev Previous commit
Next Next commit
fixup! src: fix Worker termination in inspector.waitForDebugger
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
  • Loading branch information
daeyeon committed Apr 14, 2024
commit 6a0142e53b209c730e0df68eccaa67010d0e4178
2 changes: 1 addition & 1 deletion src/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ void Environment::ExitEnv(StopFlags::Flags flags) {
set_stopping(true);

#if HAVE_INSPECTOR
if (inspector_agent_->IsWaitingForConnect()) {
if (inspector_agent_ && inspector_agent_->IsWaitingForConnect()) {
Comment thread
daeyeon marked this conversation as resolved.
Outdated
inspector_agent_->StopWaitingForConnect();
}
#endif
Expand Down
3 changes: 3 additions & 0 deletions src/inspector/main_thread_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ class MainThreadInterface :
// when we reenter the DispatchMessages function.
MessageQueue dispatching_message_queue_;
bool dispatching_messages_ = false;
// This flag indicates an internal request to exit the loop in
// WaitForFrontendEvent() It's set to true by calling
// StopWaitingForFrontendEvent().
bool stop_waiting_for_frontend_event_requested_ = false;
Comment thread
daeyeon marked this conversation as resolved.
ConditionVariable incoming_message_cond_;
// Used from any thread
Expand Down
3 changes: 3 additions & 0 deletions src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,9 @@ class NodeInspectorClient : public V8InspectorClient {
inline bool waiting_for_frontend() { return waiting_for_frontend_; }

void StopWaitingForFrontend() {
if (!waiting_for_frontend_) {
return;
}
waiting_for_frontend_ = false;
Comment thread
daeyeon marked this conversation as resolved.
for (const auto& id_channel : channels_) {
id_channel.second->unsetWaitingForDebugger();
Expand Down