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:
parent
74d580bc68
commit
8dbf62cfdb
@ -372,7 +372,10 @@ class IMAPServer:
|
|||||||
# Make sure I own all the semaphores. Let the threads finish
|
# Make sure I own all the semaphores. Let the threads finish
|
||||||
# their stuff. This is a blocking method.
|
# their stuff. This is a blocking method.
|
||||||
with self.connectionlock:
|
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)
|
threadutil.semaphorereset(self.semaphore, self.maxconnections)
|
||||||
for imapobj in self.assignedconnections + self.availableconnections:
|
for imapobj in self.assignedconnections + self.availableconnections:
|
||||||
imapobj.logout()
|
imapobj.logout()
|
||||||
|
Loading…
Reference in New Issue
Block a user