Public Class SupervisorCommThread

   ' variabile che ferma il ciclo
   Private Shared m_Stop As Boolean = False

   Private Shared m_bViewerOptimizerBlocked As Boolean = False
   Public Shared ReadOnly Property bViewerOptimizerBlocked As Boolean
      Get
         Return m_bViewerOptimizerBlocked
      End Get
   End Property
   Friend Shared Sub SetViewerOptimizerBlocked(value As Boolean, Optional AddedMachGroupId As Integer = -1)
      m_AddedMachGroupId = AddedMachGroupId
      m_bViewerOptimizerBlocked = value
   End Sub
   Public Shared m_AddedMachGroupId As Integer = -1

   Friend Shared Sub StopThread()
      m_Stop = True
   End Sub

   Public Shared Sub SupervisorCommThreadFunction()

      ' creo classe di comunicazione
      Dim m_SupervisorComm As SupervisorComm = New SupervisorComm()

      While Not m_Stop
         ' eseguo ciclo principale che tiene vivo il thread
         m_SupervisorComm.Timer_Tick()
         Threading.Thread.Sleep(TimeSpan.FromMilliseconds(1000))
      End While

   End Sub

End Class
