summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/chd.cpp
diff options
context:
space:
mode:
author MetalliC <0vetal0@gmail.com>2016-06-04 19:44:53 +0300
committer MetalliC <0vetal0@gmail.com>2016-06-04 19:44:53 +0300
commit2cea059009134005f2f930176c9cad1c13b5ba8b (patch)
treef26e268cab9ca8def6175d6e9bc95dbb4b974e78 /src/lib/util/chd.cpp
parent5cc0284cf7c79b477970fbe9cc02beedc9b4e285 (diff)
chdman: attempt to workaround hang during chd creation
TODO: find out its real cause
Diffstat (limited to 'src/lib/util/chd.cpp')
-rw-r--r--src/lib/util/chd.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/util/chd.cpp b/src/lib/util/chd.cpp
index ce4396eac29..55bc313102a 100644
--- a/src/lib/util/chd.cpp
+++ b/src/lib/util/chd.cpp
@@ -2988,7 +2988,10 @@ chd_error chd_file_compressor::compress_continue(double &progress, double &ratio
ratio = (m_total_in == 0) ? 1.0 : double(m_total_out) / double(m_total_in);
// if we're waiting for work, wait
- while (m_work_item[m_write_hunk % WORK_BUFFER_HUNKS].m_status != WS_COMPLETE && m_work_item[m_write_hunk % WORK_BUFFER_HUNKS].m_osd != nullptr)
+ // sometimes code can get here with .m_status == WS_READY and .m_osd != nullptr, TODO find out why this happens
+ while (m_work_item[m_write_hunk % WORK_BUFFER_HUNKS].m_status != WS_READY &&
+ m_work_item[m_write_hunk % WORK_BUFFER_HUNKS].m_status != WS_COMPLETE &&
+ m_work_item[m_write_hunk % WORK_BUFFER_HUNKS].m_osd != nullptr)
osd_work_item_wait(m_work_item[m_write_hunk % WORK_BUFFER_HUNKS].m_osd, osd_ticks_per_second());
return m_walking_parent ? CHDERR_WALKING_PARENT : CHDERR_COMPRESSING;