Merge branch 'master' of ssh://jpgarch@complete.org/~jpgarch/git/offlineimap

This commit is contained in:
John Goerzen
2008-08-08 13:08:08 -05:00
2 changed files with 13 additions and 5 deletions

View File

@ -18,8 +18,8 @@
from threading import *
from StringIO import StringIO
from Queue import Queue
import sys, traceback, thread
from Queue import Queue, Empty
import sys, traceback, thread, time
from offlineimap.ui import UIBase # for getglobalui()
profiledir = None
@ -89,7 +89,7 @@ class threadlist:
# Exit-notify threads
######################################################################
exitthreads = Queue(5)
exitthreads = Queue(100)
inited = 0
def initexitnotify():
@ -112,8 +112,12 @@ def exitnotifymonitorloop(callback):
"""
global exitthreads
while 1: # Loop forever.
callback(exitthreads.get(True))
exitthreads.task_done()
try:
thrd = exitthreads.get(False)
callback(thrd)
exitthreads.task_done()
except Empty:
time.sleep(1)
def threadexited(thread):
"""Called when a thread exits."""