I'm building a library in which to be consumed by a multi-threaded application. And I need a way to determine whether a particular thread is exiting.
Is there a way to add hooks or be notified when a certain Thread exits if you don't directly owns the thread?
Thread aborts are exceptional and thus I don't care about aborts, only proper exits.
This will greatly simplify the library if it is possible.
Any ideas?
You could start a separate thread of your own and Join() it to the thread in question.
However, I don't see any simpler way to get an Exited event.
(Polling IsAlive is rarely a good option)
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论