C# Call a method in a new thread

后端 未结 6 1282
甜味超标
甜味超标 2020-12-13 04:08

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 the

6条回答
  •  暖寄归人
    2020-12-13 04:39

    Once a thread is started, it is not necessary to retain a reference to the Thread object. The thread continues to execute until the thread procedure ends.

    new Thread(new ThreadStart(SecondFoo)).Start();
    

提交回复
热议问题