Open TheMates opened 3 months ago
Hmm, I'm not sure that's actually possible.
The main thread (the callAsync
block) will signal those two events and the background thread which the test is running on will wait for them in turn.
If the background (test) thread gets to the waiters first, it will wait. If they've already been signalled by the main thread, it will just run over them.
If you pause the debugger whilst the test is running, can you see what each thread is doing?
Hi, I am testing my plugin and getting false negative result on the
ParameterThreadSafetyTest()
I think that it might happen to some more cpu intensive plugins that take more time in processing.
I think this block might finish https://github.com/Tracktion/pluginval/blob/b107dd22701fc3e08ebdea8ea91a83bd25372351/Source/tests/BasicTests.cpp#L624-L634
before the main thread gets to
endWaiter.signal();
at the end of this block and we never get theendWaiter.signal()
while the main thread is waiting. https://github.com/Tracktion/pluginval/blob/b107dd22701fc3e08ebdea8ea91a83bd25372351/Source/tests/BasicTests.cpp#L651-L667I am not an expret in threading and in using JUCE thread classes, but when I decreased the number of cycles in the main loop https://github.com/Tracktion/pluginval/blob/b107dd22701fc3e08ebdea8ea91a83bd25372351/Source/tests/BasicTests.cpp#L653
to something like 10-20, the test finished successfully. I am not sure now how to fix it, but someone might be able to figure this out.