multiple modules can be refreshed with the same signal
This commit is contained in:
parent
a3ea319051
commit
7ad72a2914
1 changed files with 3 additions and 2 deletions
|
@ -6,8 +6,9 @@ class SignalRouter:
|
||||||
self.signal_thread_dictionary = {}
|
self.signal_thread_dictionary = {}
|
||||||
|
|
||||||
def __route_signal(self, signal, frame):
|
def __route_signal(self, signal, frame):
|
||||||
pthread_kill(self.signal_thread_dictionary[signal], signal)
|
for thread_ident in self.signal_thread_dictionary[signal]:
|
||||||
|
pthread_kill(thread_ident, signal)
|
||||||
|
|
||||||
def register_signal_thread(self, signal, thread_ident):
|
def register_signal_thread(self, signal, thread_ident):
|
||||||
self.signal_thread_dictionary[signal] = thread_ident
|
self.signal_thread_dictionary.setdefault(signal, []).append(thread_ident)
|
||||||
sigsignal(signal, self.__route_signal)
|
sigsignal(signal, self.__route_signal)
|
||||||
|
|
Loading…
Reference in a new issue