From 2762de52e261317acf91dcbf4117467db40898bc Mon Sep 17 00:00:00 2001 From: Arceliar Date: Thu, 30 May 2013 19:58:05 +0200 Subject: [PATCH] Moved workaround code slightly. --- src/shared.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/shared.py b/src/shared.py index 2edaf616..9ca07e69 100644 --- a/src/shared.py +++ b/src/shared.py @@ -173,20 +173,19 @@ def doCleanShutdown(): printLock.acquire() print 'Finished flushing inventory.' printLock.release() - - - if safeConfigGetBoolean('bitmessagesettings','daemon'): - printLock.acquire() - print 'Done.' - printLock.release() - os._exit(0) - + #Messy hack to kill child processes immediately. May not work on all platforms. try: os.killpg(os.getpgid(os.getpid()), signal.SIGTERM) except: os.kill(os.getpid(), signal.SIGTERM) + if safeConfigGetBoolean('bitmessagesettings','daemon'): + printLock.acquire() + print 'Done.' + printLock.release() + os._exit(0) + #Wen you want to command a sendDataThread to do something, like shutdown or send some data, this function puts your data into the queues for each of the sendDataThreads. The sendDataThreads are responsible for putting their queue into (and out of) the sendDataQueues list. def broadcastToSendDataQueues(data): #print 'running broadcastToSendDataQueues'