Answer the question
In order to leave comments, you need to log in
Is it possible to terminate another thread from the main thread?
Hello, I want to remake a bot that will create additional threads in which there will be an endless loop. And then the question arose whether I can delete this thread from the main thread and then re-create it? Otherwise, it’s not convenient to constantly log into the server and restart the bot so that something is added.
Tell me please =)
Answer the question
In order to leave comments, you need to log in
It is forbidden. A thread must manage its own life cycle. You can only send signals to it via a shared variable or some kind of synchronization primitive.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question