From 8dbf62cfdba9924e5e82b041e118f6fe059637da Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Wed, 2 Nov 2011 11:56:04 +0100 Subject: [PATCH] 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 --- offlineimap/imapserver.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/offlineimap/imapserver.py b/offlineimap/imapserver.py index 721c646..2f41bde 100644 --- a/offlineimap/imapserver.py +++ b/offlineimap/imapserver.py @@ -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()