From 0150a35dd44fd1a6a2b934c700800e24e3636499 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Thu, 21 Sep 2017 17:51:34 +0200 Subject: [PATCH] Change main thread name to PyBitmessage --- dev/powinterrupttest.py | 2 +- src/bitmessagemain.py | 2 +- src/helper_generic.py | 2 +- src/helper_threading.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/powinterrupttest.py b/dev/powinterrupttest.py index 2f8cfcac..cc4c2197 100644 --- a/dev/powinterrupttest.py +++ b/dev/powinterrupttest.py @@ -14,7 +14,7 @@ def signal_handler(signal, frame): print "Got signal %i in %s/%s" % (signal, current_process().name, current_thread().name) if current_process().name != "MainProcess": raise StopIteration("Interrupted") - if current_thread().name != "MainThread": + if current_thread().name != "PyBitmessage": return shutdown = 1 diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 1d37123f..9182b4cb 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -215,7 +215,7 @@ class Main: self.setSignalHandler() - helper_threading.set_thread_name("MainThread") + helper_threading.set_thread_name("PyBitmessage") helper_bootstrap.knownNodes() # Start the address generation thread diff --git a/src/helper_generic.py b/src/helper_generic.py index 26d65dcb..b750e519 100644 --- a/src/helper_generic.py +++ b/src/helper_generic.py @@ -51,7 +51,7 @@ def signal_handler(signal, frame): raise SystemExit if "PoolWorker" in current_process().name: raise SystemExit - if current_thread().name != "MainThread": + if current_thread().name != "PyBitmessage": return logger.error("Got signal %i", signal) if BMConfigParser().safeGetBoolean('bitmessagesettings', 'daemon'): diff --git a/src/helper_threading.py b/src/helper_threading.py index 56c5b8b2..3b7ba378 100644 --- a/src/helper_threading.py +++ b/src/helper_threading.py @@ -12,7 +12,7 @@ try: threading.Thread.__bootstrap_original__ = threading.Thread._Thread__bootstrap threading.Thread._Thread__bootstrap = _thread_name_hack except ImportError: - def set_thread_name(name): pass + def set_thread_name(name): threading.current_thread().name = name class StoppableThread(object): def initStop(self):