How to temporarily "stop" certain processing in the audio thread

Sorry again for my newbie questions... I hope one day to contribute some knowledge to other newbies ;-)

I have a convolution engine that I can pass quad channel data to. It internally makes a copy of the data that I pass (float**) to the four channel buffers.

Of course the Process method and thus the convoEngine are constantly running.

In a previous setup, my quad channel buffer always had the same address and it worked fine, also with switching between IR presets.

Now I started using the AudioSampleBuffer, which can return a different pointer each time I call the setSize method. When I pass the new IR data to the convoEngine, I also pass this new address of course and the number of samples.

With this new setup I run into heap corruption stuff. I tried to use a boolean to stop processing, but my faded memories from my computer science classes 30 years ago luckily still give me the feeling that I should use something else like a semaphore. How can I tell the processing thread not to do any more convo processing until the call to setup the new data is finished in the GUI thread?

Thanks in advance for your tips!

 

Example of RTFM or better the class documentation ;-)

 

isSuspended() and suspendProcessing(bool)