Mercurial > hg > svcore
comparison data/fft/FFTDataServer.h @ 547:806e3c72b5df
* fix deadlock in fft memory cache usage
author | Chris Cannam |
---|---|
date | Wed, 04 Feb 2009 20:39:11 +0000 |
parents | a5a17152b6df |
children | 1469caaa8e67 |
comparison
equal
deleted
inserted
replaced
546:95391b480e17 | 547:806e3c72b5df |
---|---|
169 col = x & m_cacheWidthMask; | 169 col = x & m_cacheWidthMask; |
170 int c = x >> m_cacheWidthPower; | 170 int c = x >> m_cacheWidthPower; |
171 m_cacheVectorLock.lockForRead(); | 171 m_cacheVectorLock.lockForRead(); |
172 CacheBlock *cb(m_caches.at(c)); | 172 CacheBlock *cb(m_caches.at(c)); |
173 if (cb) { | 173 if (cb) { |
174 if (cb->memoryCache) return cb->memoryCache; | 174 if (cb->memoryCache) { |
175 m_cacheVectorLock.unlock(); | |
176 return cb->memoryCache; | |
177 } | |
175 if (cb->fileCacheWriter) { | 178 if (cb->fileCacheWriter) { |
176 QThread *me = QThread::currentThread(); | 179 QThread *me = QThread::currentThread(); |
177 CacheBlock::ThreadReaderMap &map = cb->fileCacheReader; | 180 CacheBlock::ThreadReaderMap &map = cb->fileCacheReader; |
178 if (map.find(me) == map.end()) { | 181 if (map.find(me) == map.end()) { |
179 m_cacheVectorLock.unlock(); | 182 m_cacheVectorLock.unlock(); |