Reputation: 12582
I run some code inside a thread (A). At the end of that thread it creates another thread (B). Now what i want to do is at the end of thread B, i need to call thread A. when i do
_threadA.start()
from thread B system says: Thred alread started.
how to fix this?
Upvotes: 3
Views: 2272
Reputation: 4638
If you want to create a stopped thread means you should call again the stopped thread. that's only the way to do it .
Upvotes: 0
Reputation: 235984
You have to understand the life cycle of threads; after a thread is started it can not be restarted - the same applies for a stopped thread, once it's stopped its life cycle is over. Take a look at the linked article, in particular the state diagram will make things clear.
Upvotes: 5