.NET Is there a way to get the parent thread id?

后端 未结 4 1272
一向
一向 2020-12-03 15:57

Suppose the main thread is spawning a new thread t1, how can my code that runs on t1 find the thread id of the main thread (using c#)?

Edit:
I don\'t control the

4条回答
  •  粉色の甜心
    2020-12-03 16:29

    I don't know if you have a property to do that, but you could add a new parameter to your thread an pass to it. It would be the easiest way I could think of...

提交回复
热议问题