Change main thread name to PyBitmessage

This commit is contained in:
Peter Šurda 2017-09-21 17:51:34 +02:00
parent 196d688b13
commit 0150a35dd4
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87
4 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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'):

View File

@ -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):