added several printLocks to improve console output

This commit is contained in:
Jonathan Warren 2013-05-07 16:31:18 -04:00
parent 3ab48c2fe3
commit 38ae186a93
3 changed files with 9 additions and 2 deletions

View File

@ -297,7 +297,9 @@ class receiveDataThread(threading.Thread):
try: try:
del shared.connectedHostsList[self.HOST] del shared.connectedHostsList[self.HOST]
except Exception, err: except Exception, err:
shared.printLock.acquire()
print 'Could not delete', self.HOST, 'from shared.connectedHostsList.', err print 'Could not delete', self.HOST, 'from shared.connectedHostsList.', err
shared.printLock.release()
shared.UISignalQueue.put(('updateNetworkStatusTab','no data')) shared.UISignalQueue.put(('updateNetworkStatusTab','no data'))
shared.printLock.acquire() shared.printLock.acquire()
print 'The size of the connectedHostsList is now:', len(shared.connectedHostsList) print 'The size of the connectedHostsList is now:', len(shared.connectedHostsList)
@ -2046,7 +2048,6 @@ class sendDataThread(threading.Thread):
shared.printLock.release() shared.printLock.release()
self.versionSent = 1 self.versionSent = 1
def run(self): def run(self):
while True: while True:
deststream,command,data = self.mailbox.get() deststream,command,data = self.mailbox.get()

View File

@ -1315,7 +1315,9 @@ class MyForm(QtGui.QMainWindow):
self.trayIcon.hide() self.trayIcon.hide()
self.statusBar().showMessage('All done. Closing user interface...') self.statusBar().showMessage('All done. Closing user interface...')
event.accept() event.accept()
shared.printLock.acquire()
print 'Done. (passed event.accept())' print 'Done. (passed event.accept())'
shared.printLock.release()
os._exit(0) os._exit(0)
def on_action_InboxMessageForceHtml(self): def on_action_InboxMessageForceHtml(self):

View File

@ -149,7 +149,9 @@ def doCleanShutdown():
print 'Completed pickle.dump. Closing output...' print 'Completed pickle.dump. Closing output...'
output.close() output.close()
knownNodesLock.release() knownNodesLock.release()
printLock.acquire()
print 'Finished closing knownnodes.dat output file.' print 'Finished closing knownnodes.dat output file.'
printLock.release()
UISignalQueue.put(('updateStatusBar','Done saving the knownNodes list of peers to disk.')) UISignalQueue.put(('updateStatusBar','Done saving the knownNodes list of peers to disk.'))
broadcastToSendDataQueues((0, 'shutdown', 'all')) broadcastToSendDataQueues((0, 'shutdown', 'all'))
@ -165,8 +167,10 @@ def doCleanShutdown():
sqlSubmitQueue.put('SELECT address FROM subscriptions') sqlSubmitQueue.put('SELECT address FROM subscriptions')
sqlSubmitQueue.put('') sqlSubmitQueue.put('')
sqlReturnQueue.get() sqlReturnQueue.get()
sqlLock.release() sqlLock.release()
printLock.acquire()
print 'Finished flushing inventory.' print 'Finished flushing inventory.'
printLock.release()
sqlSubmitQueue.put('exit') sqlSubmitQueue.put('exit')
if safeConfigGetBoolean('bitmessagesettings','daemon'): if safeConfigGetBoolean('bitmessagesettings','daemon'):