日期:2014-05-16 浏览次数:20539 次
private object _lockFlag = new object();
private bool _threadIsRunning = false;
private bool ThreadIsRunning
{
get
{
lock (this._lockFlag) { return this._threadIsRunning; }
}
set
{
lock (this._lockFlag) { this._threadIsRunning = value; }
}
}
private void _timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if (this.ThreadIsRunning)
{
return;
}
this._service.Start();
this.ThreadIsRunning = false;
}