I have a service (WCF) that uses timers to make some operations periodically.
Generally everything work fine.
But sometimes, when I use the Visual Stiudio 2008 debugger, and stop the debugger and reactivate it, altough the timers are initialized, they are not create their callback threads.
piece of code for example that initializes the timers :
Expand|Select|Wrap|Line Numbers
- if (this.timer1 == null)
- this.timer1 = new System.Timers.Timer
- SharedDataTypes.Constants.GENERAL_ONE_SECOND);
- this.timer1 .Enabled = true;
- this.timer1.Elapsed -= new System.Timers.ElapsedEventHandler
- (timer1_Elapsed);
- this.timer1.Elapsed += new System.Timers.ElapsedEventHandler
- (timer1_Elapsed);
- this.timer1.Stop();
- this.timer1.Start();
Please tell me why they are not creates their callback thread, and how to fix it,
so that they will alays create their callback thread.
Thanks
Michael