Messy hack to kill busy child processes on exit.
This commit is contained in:
parent
74b94e7571
commit
2ae1ef0d50
|
@ -7,6 +7,7 @@ import highlevelcrypto
|
||||||
import Queue
|
import Queue
|
||||||
import pickle
|
import pickle
|
||||||
import os
|
import os
|
||||||
|
import signal
|
||||||
|
|
||||||
myECCryptorObjects = {}
|
myECCryptorObjects = {}
|
||||||
MyECSubscriptionCryptorObjects = {}
|
MyECSubscriptionCryptorObjects = {}
|
||||||
|
@ -173,12 +174,18 @@ def doCleanShutdown():
|
||||||
print 'Finished flushing inventory.'
|
print 'Finished flushing inventory.'
|
||||||
printLock.release()
|
printLock.release()
|
||||||
|
|
||||||
|
|
||||||
if safeConfigGetBoolean('bitmessagesettings','daemon'):
|
if safeConfigGetBoolean('bitmessagesettings','daemon'):
|
||||||
printLock.acquire()
|
printLock.acquire()
|
||||||
print 'Done.'
|
print 'Done.'
|
||||||
printLock.release()
|
printLock.release()
|
||||||
os._exit(0)
|
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)
|
||||||
|
|
||||||
#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.
|
#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):
|
def broadcastToSendDataQueues(data):
|
||||||
|
@ -197,4 +204,4 @@ def flushInventory():
|
||||||
sqlReturnQueue.get()
|
sqlReturnQueue.get()
|
||||||
del inventory[hash]
|
del inventory[hash]
|
||||||
sqlSubmitQueue.put('commit')
|
sqlSubmitQueue.put('commit')
|
||||||
sqlLock.release()
|
sqlLock.release()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user