@@ -28,6 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2828#include < algorithm> // std::sort
2929#include < list>
3030#include < queue>
31+ #include < atomic>
3132
3233class SorterSpikeContainer : public ReferenceCountedObject
3334{
@@ -180,7 +181,7 @@ class PCAjob
180181{
181182public:
182183 PCAjob (SorterSpikeArray& _spikes, float * _pc1, float * _pc2,
183- float *, float *, float *, float *, bool * _reportDone);
184+ float *, float *, float *, float *, std::atomic< bool >& _reportDone);
184185 ~PCAjob ();
185186 void computeCov ();
186187 void computeSVD ();
@@ -189,7 +190,7 @@ class PCAjob
189190 SorterSpikeArray spikes;
190191 float * pc1, *pc2;
191192 float * pc1min, *pc2min, *pc1max, *pc2max;
192- bool * reportDone;
193+ std::atomic< bool >& reportDone;
193194private:
194195 int svdcmp (float ** a, int nRows, int nCols, float * w, float ** v);
195196 float pythag (float a, float b);
@@ -303,7 +304,8 @@ class SpikeSortBoxes
303304 SorterSpikeArray spikeBuffer;
304305 int bufferSize,spikeBufferIndex;
305306 PCAcomputingThread* computingThread;
306- bool bPCAJobSubmitted,bPCAcomputed,bRePCA,bPCAjobFinished ;
307+ bool bPCAJobSubmitted,bPCAcomputed,bRePCA;
308+ std::atomic<bool > bPCAjobFinished ;
307309
308310
309311};
0 commit comments