mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 13:36:30 +03:00
fix(python): add workaround for interrupt_idle race condition
This commit is contained in:
@@ -578,6 +578,11 @@ class IOThreads:
|
||||
|
||||
def stop(self, wait=False):
|
||||
self._thread_quitflag = True
|
||||
|
||||
# Workaround for a race condition. Make sure that thread is
|
||||
# not in between checking for quitflag and entering idle.
|
||||
time.sleep(0.5)
|
||||
|
||||
lib.dc_interrupt_imap_idle(self._dc_context)
|
||||
lib.dc_interrupt_smtp_idle(self._dc_context)
|
||||
lib.dc_interrupt_mvbox_idle(self._dc_context)
|
||||
|
||||
Reference in New Issue
Block a user