Possible Duplicate:
.NET Is there a way to get the parent thread id?
Is there any relationship between threads in .NET? I urgently need to get the parent thread from the actual thread and there is no way to handover this piece of information. Is there any way to get parent thread in .NET or using the Win32 API?
Is there any way to get parent thread from any other thread?
.NET does not record parent-child relationships between threads. You will need to track this data on your own, by passing the parent thread to the child on creation.
That said, I cannot possibly imagine why you would need this. Isn't Join
ing from the parent or something good enough?
I can understand that you might be frustrated by questions like "What are you trying to do, anyway?" - but often times if you let us know what your true goal is we may be able to find a better way that you didn't think of. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With