I’ve made a sequencer, which uses Time::waitForMillisecondCounter to precisely wait between consecutive events. This is running in its own thread.
It works beautifully, but when I want to stop the thread during playback, my option is to either wait for the waitForMillisecondCounter to run its course by giving its time to stopThread(), or to call stopThread with a much shorter time, but then I get the “Bad Karma” assertion in juce_thread.cpp’s stopThread definition.
As far as I understand it, to avoid the “Bad Karma” warning, I have to find a way to stop the waitForMillisecondCounter to run its course, but I don’t see any way to do that.
Am I missing something? I guess I can live with the Bad Karma, but the OCD programmer in me wants to do this “The right way”