Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27072

System.Timers.Timer Elapsed event locking?

$
0
0
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 27072

Trending Articles



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