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