diff data/fileio/FileReadThread.cpp @ 742:c10cb8782576 coreaudio_tests

Merge from branch "default"
author Chris Cannam
date Sun, 01 Jul 2012 11:53:00 +0100
parents 1424aa29ae95
children e802e550a1f2
line wrap: on
line diff
--- a/data/fileio/FileReadThread.cpp	Mon Nov 29 12:45:39 2010 +0000
+++ b/data/fileio/FileReadThread.cpp	Sun Jul 01 11:53:00 2012 +0100
@@ -20,6 +20,7 @@
 
 #include <iostream>
 #include <unistd.h>
+#include <cstdio>
 
 //#define DEBUG_FILE_READ_THREAD 1
 
@@ -46,7 +47,7 @@
     notifyCancelled();
 
 #ifdef DEBUG_FILE_READ_THREAD
-    std::cerr << "FileReadThread::run() exiting" << std::endl;
+    SVDEBUG << "FileReadThread::run() exiting" << endl;
 #endif
 }
 
@@ -54,7 +55,7 @@
 FileReadThread::finish()
 {
 #ifdef DEBUG_FILE_READ_THREAD
-    std::cerr << "FileReadThread::finish()" << std::endl;
+    SVDEBUG << "FileReadThread::finish()" << endl;
 #endif
 
     {
@@ -72,7 +73,7 @@
     m_condition.wakeAll();
 
 #ifdef DEBUG_FILE_READ_THREAD
-    std::cerr << "FileReadThread::finish() exiting" << std::endl;
+    SVDEBUG << "FileReadThread::finish() exiting" << endl;
 #endif
 }
 
@@ -112,7 +113,7 @@
     }
 
 #ifdef DEBUG_FILE_READ_THREAD
-    std::cerr << "FileReadThread::cancel(" << token << ") waking condition" << std::endl;
+    SVDEBUG << "FileReadThread::cancel(" << token << ") waking condition" << endl;
 #endif
 
     m_condition.wakeAll();
@@ -215,7 +216,7 @@
     m_mutex.unlock();
 
 #ifdef DEBUG_FILE_READ_THREAD
-    std::cerr << "FileReadThread::process: reading " << request.start << ", " << request.size << " on " << request.fd << std::endl;
+    SVDEBUG << "FileReadThread::process: reading " << request.start << ", " << request.size << " on " << request.fd << endl;
 #endif
 
     bool successful = false;
@@ -288,14 +289,14 @@
         m_queue.erase(token);
         m_readyRequests[token] = request;
 #ifdef DEBUG_FILE_READ_THREAD
-        std::cerr << "FileReadThread::process: done, marking as ready (success = " << m_readyRequests[token].successful << ")" << std::endl;
+        SVDEBUG << "FileReadThread::process: done, marking as ready (success = " << m_readyRequests[token].successful << ")" << endl;
 #endif
     } else {
 #ifdef DEBUG_FILE_READ_THREAD
         if (m_exiting) {
-            std::cerr << "FileReadThread::process: exiting" << std::endl;
+            SVDEBUG << "FileReadThread::process: exiting" << endl;
         } else {
-            std::cerr << "FileReadThread::process: request disappeared" << std::endl;
+            SVDEBUG << "FileReadThread::process: request disappeared" << endl;
         }
 #endif
     }
@@ -311,7 +312,7 @@
         int token = *m_newlyCancelled.begin();
 
 #ifdef DEBUG_FILE_READ_THREAD
-        std::cerr << "FileReadThread::notifyCancelled: token " << token << std::endl;
+        SVDEBUG << "FileReadThread::notifyCancelled: token " << token << endl;
 #endif
 
         m_newlyCancelled.erase(token);