[quote=“TheVinn”]This is exacty what vf::ThreadWithCallQueue is for.
Given
vf::ThreadWithCallQueue t;
And this method:
void ProductsComponent::findFileAsync ()
{
Manager m;
String name = m.findFile(); // takes much time
vf::MessageThread::getInstance().call (&Label::setText, anyLabel, name, false);
}
From a separate thread where c is a pointer to ProductsComponent we can issue
t.call (&ProductsComponent::findFileAsync, c);
Note that we don’t have to lock the message thread anymore, this uses vf::MessageThread instead.[/quote]
Hi! Thanks fir this.I’ll look at it since it is interesting to me, but my question is not about locking messages.
Ok, just to clarify my problem. My real task is - when I push a button, a component starts installation (unpacking, moving multiple files etc.) in the separated thread inside
void ProductsComponent::run()
{
}
If I push another button to stop intallation, then a messagebox is shown with text “Are you really want to stop installation”. It means that during the time when messagebox is shown I should suspend my installation thread. If I push “Yes” it stops the thread, if “No” - resumes the one. First of all I’d like to know if it is possible to do with standard juce? If no I’ll probably go with vflib