'Called by any thread'

def load_checkpoint(self):

    def do_load_checkpoint():
        with self.session_lock:
            for (i, filename) in enumerate(iglob(os.path.join(self.session.get_downloads_pstate_dir(), '*.state'))):
                self.resume_download(filename, setupDelay=(i * 0.1))
    if self.initComplete:
        do_load_checkpoint()
    else:
        self.register_task('load_checkpoint', reactor.callLater(1, do_load_checkpoint))
