Skip to content

Commit

Permalink
inspector: dynamically invoke agent with SIGUSR2
Browse files Browse the repository at this point in the history
SIGUSR1 invokes the old debug agent, but there's
no way to invoke the new inspector agent. This
sets SIGUSR2 to do that.

PR-URL: tbd
Reviewed-By: tbd
Reviewed-By: tbd
  • Loading branch information
joshgav committed Sep 12, 2016
1 parent f1629e7 commit 0edde39
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3845,6 +3845,7 @@ static void DispatchDebugMessagesAsyncCallback(uv_async_t* handle) {

#ifdef __POSIX__
static void EnableDebugSignalHandler(int signo) {
if (signo == SIGUSR2) use_inspector = true;
uv_sem_post(&debug_semaphore);
}

Expand Down Expand Up @@ -3923,9 +3924,11 @@ static int RegisterDebugSignalHandler() {
return -err;
}
RegisterSignalHandler(SIGUSR1, EnableDebugSignalHandler);
RegisterSignalHandler(SIGUSR2, EnableDebugSignalHandler);
// Unblock SIGUSR1. A pending SIGUSR1 signal will now be delivered.
sigemptyset(&sigmask);
sigaddset(&sigmask, SIGUSR1);
sigaddset(&sigmask, SIGUSR2);
CHECK_EQ(0, pthread_sigmask(SIG_UNBLOCK, &sigmask, nullptr));
return 0;
}
Expand Down

0 comments on commit 0edde39

Please sign in to comment.