Browse Source

Change main thread name to PyBitmessage

master
Peter Šurda 5 years ago
parent
commit
0150a35dd4
Signed by untrusted user: PeterSurda GPG Key ID: 0C5F50C0B5F37D87
  1. 2
      dev/powinterrupttest.py
  2. 2
      src/bitmessagemain.py
  3. 2
      src/helper_generic.py
  4. 2
      src/helper_threading.py

2
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

2
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

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

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

Loading…
Cancel
Save