I am likely not understanding threads. Below is a screen grab of a simple program. The program begins and nothing has started. Press the ‘Start Thread 1’ button and the music plays in the background and the button action shows ‘Pressed Run’, and Thread State shows ‘Not Running’ even though it is running. Press ‘Recheck Thread State’ button to update the label - nothing changes. Press the ‘Show ‘Test’’ button and the label changes to Test.
If I press the ‘Start Thread 1’ button again, there are now two versions of background music playing at the same time on the same thread that should have been killed.
Below is the download link for the program.
Yes, I can start and stop the music on its own. I thought that killing a thread with playing music will also stop the music - I understand that this is not the correct way to stop sound.
What am I missing to be able to kill, suspend, sleep, and resume a thread, while viewing the thread state? Thanks for your help with this noobie question…