From 38ae186a931e505514a62c938e1aeaed98b1ccc7 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Tue, 7 May 2013 16:31:18 -0400 Subject: [PATCH] added several printLocks to improve console output --- src/bitmessagemain.py | 3 ++- src/bitmessageqt/__init__.py | 2 ++ src/shared.py | 6 +++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 47631cfc..c11f7013 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -297,7 +297,9 @@ class receiveDataThread(threading.Thread): try: del shared.connectedHostsList[self.HOST] except Exception, err: + shared.printLock.acquire() print 'Could not delete', self.HOST, 'from shared.connectedHostsList.', err + shared.printLock.release() shared.UISignalQueue.put(('updateNetworkStatusTab','no data')) shared.printLock.acquire() print 'The size of the connectedHostsList is now:', len(shared.connectedHostsList) @@ -2046,7 +2048,6 @@ class sendDataThread(threading.Thread): shared.printLock.release() self.versionSent = 1 - def run(self): while True: deststream,command,data = self.mailbox.get() diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 52dba18a..3c013ace 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1315,7 +1315,9 @@ class MyForm(QtGui.QMainWindow): self.trayIcon.hide() self.statusBar().showMessage('All done. Closing user interface...') event.accept() + shared.printLock.acquire() print 'Done. (passed event.accept())' + shared.printLock.release() os._exit(0) def on_action_InboxMessageForceHtml(self): diff --git a/src/shared.py b/src/shared.py index 0eb7fa18..ed1baf22 100644 --- a/src/shared.py +++ b/src/shared.py @@ -149,7 +149,9 @@ def doCleanShutdown(): print 'Completed pickle.dump. Closing output...' output.close() knownNodesLock.release() + printLock.acquire() print 'Finished closing knownnodes.dat output file.' + printLock.release() UISignalQueue.put(('updateStatusBar','Done saving the knownNodes list of peers to disk.')) broadcastToSendDataQueues((0, 'shutdown', 'all')) @@ -165,8 +167,10 @@ def doCleanShutdown(): sqlSubmitQueue.put('SELECT address FROM subscriptions') sqlSubmitQueue.put('') sqlReturnQueue.get() - sqlLock.release() + sqlLock.release() + printLock.acquire() print 'Finished flushing inventory.' + printLock.release() sqlSubmitQueue.put('exit') if safeConfigGetBoolean('bitmessagesettings','daemon'):