I'm almost certain this is the problem I half-fixed in
4e0e221078da9a0ac32654108b3af63d335c9654 (which I left out of 3.2.0, not
wanting to burden Abhijit with more last-minute fixes). That appears not to
be enough.
The code of the problem is describe in the manpage for pthread_join:
There is no pthreads analog of waitpid(-1, &status, 0), that
is,
"join with any terminated thread". If you believe you need
this
functionality, you probably need to rethink your application design.
Our design has one thread for each TLS connection and depending on whether
connections are closed using a POP/IMAP/SMTP-level command or at the TCP
level by aborting the connection, either the thread itself or the
mothership may terminate the TLS thread.
We've tried to ensure that if the thread kills itself, then there is an
information roundtrip and the mothership performs the necessary cleanup.
But I suspect that it's not perfect.
Arnt