threading: minor improvements

Factorize string, enhance comments and minor code improvements.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht
2016-05-17 03:53:09 +02:00
parent f93b0963fa
commit 83539f8601
4 changed files with 27 additions and 12 deletions

View File

@ -871,11 +871,12 @@ class BaseFolder(object):
# exceptions are caught in copymessageto()
if self.suggeststhreads() and not globals.options.singlethreading:
self.waitforthread()
thread = threadutil.InstanceLimitedThread(\
thread = threadutil.InstanceLimitedThread(
self.getcopyinstancelimit(),
target = self.copymessageto,
name = "Copy message from %s:%s" % (self.repository, self),
args = (uid, dstfolder, statusfolder))
args = (uid, dstfolder, statusfolder)
)
thread.start()
threads.append(thread)
else: