Don't setDaemon explicitly, it's done inherently
All ExitNotifyThreads and InstanceLimitThreads are setDaemon(True) in their constructor, so there is no need to do that again in the code. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
parent
4eeb88dd8f
commit
d54859a931
@ -291,7 +291,6 @@ class SyncableAccount(Account):
|
|||||||
name = "Folder %s [acc: %s]" % (remotefolder, self),
|
name = "Folder %s [acc: %s]" % (remotefolder, self),
|
||||||
args = (self.name, remoterepos, remotefolder, localrepos,
|
args = (self.name, remoterepos, remotefolder, localrepos,
|
||||||
statusrepos, quick))
|
statusrepos, quick))
|
||||||
thread.setDaemon(1)
|
|
||||||
thread.start()
|
thread.start()
|
||||||
folderthreads.append(thread)
|
folderthreads.append(thread)
|
||||||
# wait for all threads to finish
|
# wait for all threads to finish
|
||||||
|
@ -341,7 +341,6 @@ class BaseFolder(object):
|
|||||||
target = self.copymessageto,
|
target = self.copymessageto,
|
||||||
name = "Copy message from %s:%s" % (self.repository, self),
|
name = "Copy message from %s:%s" % (self.repository, self),
|
||||||
args = (uid, dstfolder, statusfolder))
|
args = (uid, dstfolder, statusfolder))
|
||||||
thread.setDaemon(1)
|
|
||||||
thread.start()
|
thread.start()
|
||||||
threads.append(thread)
|
threads.append(thread)
|
||||||
else:
|
else:
|
||||||
|
@ -358,7 +358,6 @@ class OfflineImap:
|
|||||||
name='Sync Runner',
|
name='Sync Runner',
|
||||||
kwargs = {'accounts': syncaccounts,
|
kwargs = {'accounts': syncaccounts,
|
||||||
'config': self.config})
|
'config': self.config})
|
||||||
t.setDaemon(True)
|
|
||||||
t.start()
|
t.start()
|
||||||
threadutil.exitnotifymonitorloop(threadutil.threadexited)
|
threadutil.exitnotifymonitorloop(threadutil.threadexited)
|
||||||
self.ui.terminate()
|
self.ui.terminate()
|
||||||
|
@ -28,8 +28,8 @@ from offlineimap.ui import getglobalui
|
|||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
def semaphorereset(semaphore, originalstate):
|
def semaphorereset(semaphore, originalstate):
|
||||||
"""Wait until the semaphore gets back to its original state -- all acquired
|
"""Block until `semaphore` gets back to its original state, ie all acquired
|
||||||
resources released."""
|
resources have been released."""
|
||||||
for i in range(originalstate):
|
for i in range(originalstate):
|
||||||
semaphore.acquire()
|
semaphore.acquire()
|
||||||
# Now release these.
|
# Now release these.
|
||||||
|
Loading…
Reference in New Issue
Block a user