From 23d09bfa5d3494ac0dacc1acfe0978c6ca6874ba Mon Sep 17 00:00:00 2001 From: Ravi Date: Mon, 11 Jul 2011 00:20:47 -0400 Subject: [PATCH] check isAlive for all the threads before calling join --- youtube-dl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/youtube-dl b/youtube-dl index abe5a8018..92ebb8655 100755 --- a/youtube-dl +++ b/youtube-dl @@ -3055,10 +3055,11 @@ if __name__ == '__main__': #wait for download threads to terminate if downloadparallel > 0: - while True: - if( not threads[0].isAlive()): - break - time.sleep(1) + for threadcount in xrange(downloadparallel): + while True: + if( not threads[threadcount].isAlive()): + break + time.sleep(1) for threadcount in xrange(downloadparallel): threads[threadcount].join()