Mercurial > hg > svcore
comparison data/fft/FFTMemoryCache.cpp @ 548:1469caaa8e67
* Finer locking in fft caches; fix displayed bin ranges in spectrogram
author | Chris Cannam |
---|---|
date | Thu, 05 Feb 2009 12:05:28 +0000 |
parents | 3cc4b7cd2aa5 |
children | e802e550a1f2 |
comparison
equal
deleted
inserted
replaced
547:806e3c72b5df | 548:1469caaa8e67 |
---|---|
146 setMagnitudeAt(x, y, mags[y]); | 146 setMagnitudeAt(x, y, mags[y]); |
147 setPhaseAt(x, y, phases[y]); | 147 setPhaseAt(x, y, phases[y]); |
148 } | 148 } |
149 } | 149 } |
150 | 150 |
151 m_colsetMutex.lock(); | 151 m_colsetLock.lockForWrite(); |
152 m_colset.set(x); | 152 m_colset.set(x); |
153 m_colsetMutex.unlock(); | 153 m_colsetLock.unlock(); |
154 } | 154 } |
155 | 155 |
156 void | 156 void |
157 FFTMemoryCache::setColumnAt(size_t x, float *reals, float *imags) | 157 FFTMemoryCache::setColumnAt(size_t x, float *reals, float *imags) |
158 { | 158 { |
186 } | 186 } |
187 }; | 187 }; |
188 | 188 |
189 if (m_storageType == FFTCache::Rectangular) { | 189 if (m_storageType == FFTCache::Rectangular) { |
190 m_factor[x] = max; | 190 m_factor[x] = max; |
191 m_colsetMutex.lock(); | 191 m_colsetLock.lockForWrite(); |
192 m_colset.set(x); | 192 m_colset.set(x); |
193 m_colsetMutex.unlock(); | 193 m_colsetLock.unlock(); |
194 } else { | 194 } else { |
195 setColumnAt(x, reals, imags, max); | 195 setColumnAt(x, reals, imags, max); |
196 } | 196 } |
197 } | 197 } |
198 | 198 |