[PATCH v2] Re: Simplify exit thread evaluation

Nicolas Sebrecht nicolas.s-dev at laposte.net
Sat Dec 4 11:23:02 GMT 2010

On Wed, Dec 01, 2010 at 11:35:47PM +0100, Sebastian Spaeth wrote:
> Rather than sleeping for 1 second and poll our exitthread Queue in a
> non-bloking fashion simply call it in a blocking fashion. Works for
> me, and is somewhat faster as we don't finish our 1 second sleep even
> after a thread exited. This version v2 makes sure to work with SIGINT
> again (cf http://bugs.python.org/issue1360).

The subject is wrong. You are fixing a time lock.

References to a version 2 in your commit message doesn't make sense
since this information isn't keep in the Git history.

> +    """An infinite "monitoring" loop watching for finished ExitNotifyThread's.
> +
> +    :param callback: the function to call when a thread terminated. That 
> +                     function is called with a single argument -- the 
> +                     ExitNotifyThread that has terminated. The monitor will 
> +                     not continue to monitor for other threads until
> +                     'callback' returns, so if it intends to perform long
> +                     calculations, it should start a new thread itself -- but
> +                     NOT an ExitNotifyThread, or else an infinite loop 
> +                     may result.
> +                     Furthermore, the monitor will hold the lock all the 
> +                     while the other thread is waiting.
> +    :type callback:  a callable function

You are breacking the usual style here. I guess this is related to the
Sphinx documentation but I'm not convinced this is erverybody want. You
can keep your style since it won't break anything else but we really
need documentation merged for later.

Nicolas Sebrecht

More information about the OfflineIMAP-project mailing list