trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject [trafficserver] 03/06: Wake the process manager thread on shutdown.
Date Tue, 06 Jun 2017 02:55:59 GMT
This is an automated email from the ASF dual-hosted git repository.

jpeach pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 8c4a0eae65d9a49ef3017afa6e593417fb2be9a3
Author: James Peach <jpeach@apache.org>
AuthorDate: Wed May 24 23:00:15 2017 -0700

    Wake the process manager thread on shutdown.
    
    If we are trying to stop the ProcessManager, the poll thread might
    be sleeping, so we now send it SIGINT to break the sleep. This
    causes it to notice that it should no longer be running earlier.
---
 lib/ts/ink_thread.h    | 6 ++++++
 mgmt/ProcessManager.cc | 1 +
 2 files changed, 7 insertions(+)

diff --git a/lib/ts/ink_thread.h b/lib/ts/ink_thread.h
index a5baffd..501170f 100644
--- a/lib/ts/ink_thread.h
+++ b/lib/ts/ink_thread.h
@@ -213,6 +213,12 @@ ink_thread_sigsetmask(int how, const sigset_t *set, sigset_t *oset)
   return (pthread_sigmask(how, set, oset));
 }
 
+static inline int
+ink_thread_kill(ink_thread t, int sig)
+{
+  return pthread_kill(t, sig);
+}
+
 /*******************************************************************
  * Posix Semaphores
  ******************************************************************/
diff --git a/mgmt/ProcessManager.cc b/mgmt/ProcessManager.cc
index f4616f3..663f206 100644
--- a/mgmt/ProcessManager.cc
+++ b/mgmt/ProcessManager.cc
@@ -115,6 +115,7 @@ ProcessManager::stop()
 
   local_manager_sockfd = -1;
   close_socket(tmp);
+  ink_thread_kill(poll_thread, SIGINT);
 
   ink_thread_join(poll_thread);
   poll_thread = ink_thread_null();

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>.

Mime
View raw message