comparison data/fileio/FileReadThread.cpp @ 843:e802e550a1f2

Drop std:: from cout, cerr, endl -- pull these in through Debug.h
author Chris Cannam
date Tue, 26 Nov 2013 13:35:08 +0000
parents 1424aa29ae95
children c811991a5efa
comparison
equal deleted inserted replaced
842:23d3a6eca5c3 843:e802e550a1f2
106 m_newlyCancelled.insert(token); 106 m_newlyCancelled.insert(token);
107 } else if (m_readyRequests.find(token) != m_readyRequests.end()) { 107 } else if (m_readyRequests.find(token) != m_readyRequests.end()) {
108 m_cancelledRequests[token] = m_readyRequests[token]; 108 m_cancelledRequests[token] = m_readyRequests[token];
109 m_readyRequests.erase(token); 109 m_readyRequests.erase(token);
110 } else { 110 } else {
111 std::cerr << "WARNING: FileReadThread::cancel: token " << token << " not found" << std::endl; 111 cerr << "WARNING: FileReadThread::cancel: token " << token << " not found" << endl;
112 } 112 }
113 } 113 }
114 114
115 #ifdef DEBUG_FILE_READ_THREAD 115 #ifdef DEBUG_FILE_READ_THREAD
116 SVDEBUG << "FileReadThread::cancel(" << token << ") waking condition" << endl; 116 SVDEBUG << "FileReadThread::cancel(" << token << ") waking condition" << endl;
193 found = true; 193 found = true;
194 } else if (m_readyRequests.find(token) != m_readyRequests.end()) { 194 } else if (m_readyRequests.find(token) != m_readyRequests.end()) {
195 m_readyRequests.erase(token); 195 m_readyRequests.erase(token);
196 found = true; 196 found = true;
197 } else if (m_queue.find(token) != m_queue.end()) { 197 } else if (m_queue.find(token) != m_queue.end()) {
198 std::cerr << "WARNING: FileReadThread::done(" << token << "): request is still in queue (wait or cancel it)" << std::endl; 198 cerr << "WARNING: FileReadThread::done(" << token << "): request is still in queue (wait or cancel it)" << endl;
199 } 199 }
200 200
201 if (!found) { 201 if (!found) {
202 std::cerr << "WARNING: FileReadThread::done(" << token << "): request not found" << std::endl; 202 cerr << "WARNING: FileReadThread::done(" << token << "): request not found" << endl;
203 } 203 }
204 } 204 }
205 205
206 void 206 void
207 FileReadThread::process() 207 FileReadThread::process()
255 } 255 }
256 } 256 }
257 257
258 if (seekFailed) { 258 if (seekFailed) {
259 ::perror("Seek failed"); 259 ::perror("Seek failed");
260 std::cerr << "ERROR: FileReadThread::process: seek to " 260 cerr << "ERROR: FileReadThread::process: seek to "
261 << request.start << " failed" << std::endl; 261 << request.start << " failed" << endl;
262 request.size = 0; 262 request.size = 0;
263 } else { 263 } else {
264 if (r < 0) { 264 if (r < 0) {
265 ::perror("ERROR: FileReadThread::process: Read failed"); 265 ::perror("ERROR: FileReadThread::process: Read failed");
266 std::cerr << "ERROR: FileReadThread::process: read of " 266 cerr << "ERROR: FileReadThread::process: read of "
267 << request.size << " at " 267 << request.size << " at "
268 << request.start << " failed" << std::endl; 268 << request.start << " failed" << endl;
269 request.size = 0; 269 request.size = 0;
270 } else if (r < ssize_t(request.size)) { 270 } else if (r < ssize_t(request.size)) {
271 std::cerr << "WARNING: FileReadThread::process: read " 271 cerr << "WARNING: FileReadThread::process: read "
272 << request.size << " returned only " << r << " bytes" 272 << request.size << " returned only " << r << " bytes"
273 << std::endl; 273 << endl;
274 request.size = r; 274 request.size = r;
275 usleep(100000); 275 usleep(100000);
276 } else { 276 } else {
277 successful = true; 277 successful = true;
278 } 278 }