revert to daemon threads because some clients do not seem to close their sockets cleanly

This commit is contained in:
thomasv 2012-12-05 10:24:30 +01:00
parent e766df1d33
commit 108dfb6140
3 changed files with 6 additions and 3 deletions

View File

@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import re import re
import sys, os import sys, os, time
import optparse import optparse
try: try:
@ -256,6 +256,9 @@ if __name__ == '__main__':
synchronizer.stop() synchronizer.stop()
interface.stop() interface.stop()
# we use daemon threads, their termination is enforced.
# this sleep command gives them time to terminate cleanly.
time.sleep(0.1)
sys.exit(0) sys.exit(0)
if cmd not in known_commands: if cmd not in known_commands:

View File

@ -29,7 +29,7 @@ class WalletVerifier(threading.Thread):
def __init__(self, interface, config): def __init__(self, interface, config):
threading.Thread.__init__(self) threading.Thread.__init__(self)
#self.daemon = True self.daemon = True
self.config = config self.config = config
self.interface = interface self.interface = interface
self.transactions = {} # requested verifications (with height sent by the requestor) self.transactions = {} # requested verifications (with height sent by the requestor)

View File

@ -1156,7 +1156,7 @@ class WalletSynchronizer(threading.Thread):
def __init__(self, wallet, config): def __init__(self, wallet, config):
threading.Thread.__init__(self) threading.Thread.__init__(self)
# self.daemon = True self.daemon = True
self.wallet = wallet self.wallet = wallet
self.interface = self.wallet.interface self.interface = self.wallet.interface
self.interface.register_channel('synchronizer') self.interface.register_channel('synchronizer')