Skip to content

Commit

Permalink
removed while statements
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyofrancis committed Jul 11, 2018
1 parent 3ac42d3 commit dbf292d
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ class DownloadManagerImpl(private val httpDownloader: Downloader,
return if (currentDownloadsMap.containsKey(id)) {
val fileDownloader = currentDownloadsMap[id] as FileDownloader
fileDownloader.interrupted = true
while (!fileDownloader.terminated) {
//Wait until download runnable terminates
}
currentDownloadsMap.remove(id)
downloadCounter -= 1
downloadManagerCoordinator.removeFileDownloader(id)
Expand All @@ -123,9 +120,6 @@ class DownloadManagerImpl(private val httpDownloader: Downloader,
private fun cancelAllDownloads() {
downloadManagerCoordinator.getFileDownloaderList().iterator().forEach {
it.interrupted = true
while (!it.terminated) {
//Wait until download runnable terminates
}
downloadManagerCoordinator.removeFileDownloader(it.download.id)
logger.d("DownloadManager cancelled download ${it.download}")
}
Expand All @@ -136,9 +130,6 @@ class DownloadManagerImpl(private val httpDownloader: Downloader,
private fun terminateAllDownloads() {
currentDownloadsMap.iterator().forEach {
it.value.terminated = true
while (!it.value.terminated) {
//Wait until download runnable terminates
}
logger.d("DownloadManager terminated download ${it.value.download}")
downloadManagerCoordinator.removeFileDownloader(it.key)
}
Expand Down

0 comments on commit dbf292d

Please sign in to comment.