Add a TODO comment

This function can IMHO lead to possible deadlocks when waiting for the
connectionlock. Do add a comment to that regard, this will need to audit.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth 2011-11-02 11:56:04 +01:00
parent 74d580bc68
commit 8dbf62cfdb

View File

@ -372,7 +372,10 @@ class IMAPServer:
# Make sure I own all the semaphores. Let the threads finish
# their stuff. This is a blocking method.
with self.connectionlock:
# first, wait till all
# first, wait till all connections had been released.
# TODO: won't work IMHO, as releaseconnection() also
# requires the connectionlock, leading to a potential
# deadlock! Audit & check!
threadutil.semaphorereset(self.semaphore, self.maxconnections)
for imapobj in self.assignedconnections + self.availableconnections:
imapobj.logout()