diff data/fileio/BQAFileReader.cpp @ 1858:14747f24ad04

Use cancellable serialiser; add some more profiling points
author Chris Cannam
date Thu, 14 May 2020 16:36:48 +0100
parents 8aa1447fe27e
children
line wrap: on
line diff
--- a/data/fileio/BQAFileReader.cpp	Thu May 14 16:35:39 2020 +0100
+++ b/data/fileio/BQAFileReader.cpp	Thu May 14 16:36:48 2020 +0100
@@ -115,12 +115,14 @@
 
 BQAFileReader::~BQAFileReader()
 {
+    Profiler profiler("BQAFileReader::~BQAFileReader");
+    
     if (m_decodeThread) {
         m_cancelled = true;
         m_decodeThread->wait();
         delete m_decodeThread;
     }
-    
+
     delete m_stream;
 }
 
@@ -134,7 +136,11 @@
 BQAFileReader::DecodeThread::run()
 {
     if (m_reader->m_cacheMode == CacheInTemporaryFile) {
-        m_reader->startSerialised("BQAFileReader::Decode");
+        m_reader->startSerialised("BQAFileReader::Decode",
+                                  &m_reader->m_cancelled);
+        if (m_reader->m_cancelled) {
+            return;
+        }
     }
 
     sv_frame_t blockSize = 65536;