I am looking for a way to call a method on a new thread (using C#).
For instance, I would like to call SecondFoo()
on a new thread. However, I would then like to have the thread terminated when SecondFoo()
finishes.
I have seen several examples of threading in C#
, but none that apply to this specific scenario where I need the spawned thread to terminate itself. Is this possible?
How can I force the spawned thread running Secondfoo()
to terminate upon completion?
Has anyone come across any examples of this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…