Change main thread name to PyBitmessage
This commit is contained in:
parent
196d688b13
commit
0150a35dd4
|
@ -14,7 +14,7 @@ def signal_handler(signal, frame):
|
||||||
print "Got signal %i in %s/%s" % (signal, current_process().name, current_thread().name)
|
print "Got signal %i in %s/%s" % (signal, current_process().name, current_thread().name)
|
||||||
if current_process().name != "MainProcess":
|
if current_process().name != "MainProcess":
|
||||||
raise StopIteration("Interrupted")
|
raise StopIteration("Interrupted")
|
||||||
if current_thread().name != "MainThread":
|
if current_thread().name != "PyBitmessage":
|
||||||
return
|
return
|
||||||
shutdown = 1
|
shutdown = 1
|
||||||
|
|
||||||
|
|
|
@ -215,7 +215,7 @@ class Main:
|
||||||
|
|
||||||
self.setSignalHandler()
|
self.setSignalHandler()
|
||||||
|
|
||||||
helper_threading.set_thread_name("MainThread")
|
helper_threading.set_thread_name("PyBitmessage")
|
||||||
|
|
||||||
helper_bootstrap.knownNodes()
|
helper_bootstrap.knownNodes()
|
||||||
# Start the address generation thread
|
# Start the address generation thread
|
||||||
|
|
|
@ -51,7 +51,7 @@ def signal_handler(signal, frame):
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
if "PoolWorker" in current_process().name:
|
if "PoolWorker" in current_process().name:
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
if current_thread().name != "MainThread":
|
if current_thread().name != "PyBitmessage":
|
||||||
return
|
return
|
||||||
logger.error("Got signal %i", signal)
|
logger.error("Got signal %i", signal)
|
||||||
if BMConfigParser().safeGetBoolean('bitmessagesettings', 'daemon'):
|
if BMConfigParser().safeGetBoolean('bitmessagesettings', 'daemon'):
|
||||||
|
|
|
@ -12,7 +12,7 @@ try:
|
||||||
threading.Thread.__bootstrap_original__ = threading.Thread._Thread__bootstrap
|
threading.Thread.__bootstrap_original__ = threading.Thread._Thread__bootstrap
|
||||||
threading.Thread._Thread__bootstrap = _thread_name_hack
|
threading.Thread._Thread__bootstrap = _thread_name_hack
|
||||||
except ImportError:
|
except ImportError:
|
||||||
def set_thread_name(name): pass
|
def set_thread_name(name): threading.current_thread().name = name
|
||||||
|
|
||||||
class StoppableThread(object):
|
class StoppableThread(object):
|
||||||
def initStop(self):
|
def initStop(self):
|
||||||
|
|
Reference in New Issue
Block a user