I searched at the Internet about stopping a thread. I could only find a deprecated method and a while method which doesn't really work.
My idea is declaring a custom exception and putting a try in the thread so I can stop that thread by throwing the exception.
Is my idea non-sense and is that why I can't find an answer like this on the Internet?