<p>This may solve my deadlock issue from the other thread if it is correct. I'll test it later, thanks.</p>
<div class="gmail_quote">On Dec 1, 2010 11:07 AM, "Sebastian Spaeth" <<a href="mailto:Sebastian@sspaeth.de">Sebastian@sspaeth.de</a>> wrote:<br type="attribution">> Rather than sleeping for 1 second and poll our exitthread Queue in a<br>
> non-bloking fashion simply call it in a blocking fashion. Works for<br>> me, and is potentially somewhat faster as we don't do unnecessary<br>> sleeps after a thread exited.<br>> <br>> Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de><br>
> ---<br>> offlineimap/threadutil.py | 10 ++++------<br>> 1 files changed, 4 insertions(+), 6 deletions(-)<br>> <br>> diff --git a/offlineimap/threadutil.py b/offlineimap/threadutil.py<br>> index b516f68..579ef35 100644<br>
> --- a/offlineimap/threadutil.py<br>> +++ b/offlineimap/threadutil.py<br>> @@ -111,12 +111,10 @@ def exitnotifymonitorloop(callback):<br>> the monitor will hold the lock all the while the other thread is waiting.<br>
> """<br>> global exitthreads<br>> - while 1: # Loop forever.<br>> - try:<br>> - thrd = exitthreads.get(False)<br>> - callback(thrd)<br>
> - except Empty:<br>> - time.sleep(1)<br>> + while 1: <br>> + # Loop forever and call 'callback' for each thread that exited<br>> + thrd = exitthreads.get(True)<br>
> + callback(thrd)<br>> <br>> def threadexited(thread):<br>> """Called when a thread exits."""<br>> -- <br>> 1.7.1<br>> <br>> <br>> _______________________________________________<br>
> OfflineIMAP-project mailing list<br>> <a href="mailto:OfflineIMAP-project@lists.alioth.debian.org">OfflineIMAP-project@lists.alioth.debian.org</a><br>> <a href="http://lists.alioth.debian.org/mailman/listinfo/offlineimap-project">http://lists.alioth.debian.org/mailman/listinfo/offlineimap-project</a><br>
> <br>> OfflineIMAP homepage: <a href="http://software.complete.org/offlineimap">http://software.complete.org/offlineimap</a><br></div>