How do I gracefully stop a System.Threading.Timer?

后端 未结 4 792
星月不相逢
星月不相逢 2021-02-13 03:57

I have a Windows Service implemented in C# that needs to do some work every so often. I\'ve implemented this using a System.Threading.Timer with a callback method t

4条回答
  •  悲哀的现实
    2021-02-13 04:36

    Possible solution for protecting the callback method from working on a disposed timer:

    https://stackoverflow.com/a/15902261/193178

提交回复
热议问题