Skip to content

Commit c886fab

Browse files
authored
Merge pull request #215 from yuchen0cc/main
bk_download: wait verify finish
2 parents 1a24ade + f1a27d3 commit c886fab

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/bk_download.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,9 @@ bool BkDownload::download_done() {
116116
done.signal(1);
117117
});
118118
sha256_thread.detach();
119-
while (running == 1) {
120-
if (done.wait(1, 200 * 1000) == 0)
121-
break;
122-
}
119+
// wait verify finish
120+
done.wait(1);
121+
123122
if (shares != digest) {
124123
LOG_ERROR("verify checksum ` failed (expect: `, got: `)", old_name, digest, shares);
125124
force_download = true; // force redownload next time
@@ -294,4 +293,4 @@ void bk_download_proc(std::list<BKDL::BkDownload *> &dl_list, uint64_t delay_sec
294293
LOG_INFO("BACKGROUND DOWNLOAD THREAD EXIT.");
295294
}
296295

297-
} // namespace BKDL
296+
} // namespace BKDL

0 commit comments

Comments
 (0)