isbackground

Can I safely rely on IsBackground in Threads when the application terminates?

一个人想着一个人 提交于 2019-12-06 04:16:26
问题 I'm running some background threads in the GUI. Currently I'm implementing a personal Thread cancellation code but there is IsBackground property in threads and according MSDN they'll cancel themselves. I know that it's going to Thread.Abort() which is nasty but there is nothing going in this background threads that I need to keep a proper state or requires proper clean-up. I'm trying to avoid any crashes if the user just closes down the application in the middle of a background thread. Since