Hi, you can try this:
private object _locker = new object(); private void timer_Elapsed(object sender, ElapsedEventArgs e) { lock (this._locker) { ...do timer stuff.... } } void DoStuff() { lock (this._locker) { ...do my stuff... } }
No comments:
Post a Comment