How to terminate a thread which has spawned another thread which is sleeping?
Posted
by Bobb
on Stack Overflow
See other posts from Stack Overflow
or by Bobb
Published on 2010-06-13T19:32:21Z
Indexed on
2010/06/13
20:42 UTC
Read the original article
Hit count: 227
I have a long running thread made from Thread.Start(). It spawns a background thread using QueueUserWorkItem which sleeps most of the time.
Then the class-owner get disposed I call thread1.Join() but naturally it doesnt return because its child background thread is sleeping.
What would be the right solution to gracefully terminate a thread which has other threads with little hassle?
© Stack Overflow or respective owner