I am experiencing a weird problem when updating UI from a thread.
Threads are as follows:
Thread1 (main thread):
- has locked message manger
- control is currently in a button clicked
- this thread needs to stop Thread2 which is updating UI.(cannot continue untill the thread2 exits/stops)
- Doing some work…
- Tries to lock the message-manager since it needs to update the UI.
But Thread 1 (main thread) has already locked the message manager.
Thread1 has locked the messagemanger and is waiting for thread2 to exit.
Thread2 in its run method trying to Lock the messagemanger( already locked by Thread1)
This could be bad programming practice/strategy from my side rather than
juce issue. I am just asking for ideas or work around.
Thanks in advance for any ideas or help