Quantcast
Viewing all articles
Browse latest Browse all 27083

System.Timers.Timer Elapsed event locking?

Trying to make it so that the Timer event doesn't process if another one is still in process, this doesn't seem to be working:

Code:

Public Partial Class srvcCRISReporting
        Inherits ServiceBase
        Private thisLock As New [Object]()

        Private Sub tmrReports_Elapsed(sender As Object, e As System.Timers.ElapsedEventArgs)
                ' Don't fire tick event while another tick event is running
                SyncLock thisLock
                        ' Event Code here

                End SyncLock
        End Sub
End Class


Viewing all articles
Browse latest Browse all 27083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>