How to Kill a C# Thread?

后端 未结 4 1330
抹茶落季
抹茶落季 2021-01-13 09:56

I\'ve got a thread that goes out and looks up data on our (old) SQL server.

As data comes in, I post information to a modal dialog box - the user can\'t & should

4条回答
  •  猫巷女王i
    2021-01-13 10:23

    You should signal your event when the user clicks Cancel (not kill the thread). In your example, the ManualResetEvent "mre"'s scope should be outside the thread function.

提交回复
热议问题