From 2cea059009134005f2f930176c9cad1c13b5ba8b Mon Sep 17 00:00:00 2001 From: MetalliC <0vetal0@gmail.com> Date: Sat, 4 Jun 2016 19:44:53 +0300 Subject: chdman: attempt to workaround hang during chd creation TODO: find out its real cause --- src/lib/util/chd.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib/util/chd.cpp') 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; -- cgit v1.2.3-70-g09d2