static public void StartAllThreads() { FoxEventLog.VerboseWriteEventLog("StartAllThreads()", System.Diagnostics.EventLogEntryType.Information); ReportingThreadHandle1 = new Thread(new ThreadStart(ReportingThread1)); ReportingThreadHandle2 = new Thread(new ThreadStart(ReportingThread2)); PolicyThreadHandle = new Thread(new ThreadStart(PolicyThread)); DownloadThreadHandle = new Thread(new ThreadStart(DownloadThread)); ReportingThreadHandle1.Start(); ReportingThreadHandle2.Start(); PolicyThreadHandle.Start(); DownloadThreadHandle.Start(); PushMain0.StartPushThread(); PushMain1.StartPushThread(); PushMain2.StartPushThread(); #if ENABLECHAT PushMain10.StartPushThread(); #endif UpdateCheck.RunUpdateCheckAndHouseKeepingThread(); DownloadSystemFSData.StartThread(); if (SystemInfos.SysInfo.RunningInWindowsPE == false || SystemInfos.SysInfo.RunningInWindowsPE == null) { LocalPackagesHandle = new Thread(new ThreadStart(LocalPackagesThread)); LocalPackagesHandle.Start(); } FoxEventLog.VerboseWriteEventLog("StartAllThreads() - DONE", System.Diagnostics.EventLogEntryType.Information); }
static public void StopAllThreads() { FoxEventLog.VerboseWriteEventLog("StopAllThreads()", System.Diagnostics.EventLogEntryType.Information); StopThreads = true; Redirs.PortMappings_Kernel.StopAllConnections(); if (PolicyThreadHandle != null) { PolicyThreadHandle.Join(); } if (ReportingThreadHandle1 != null) { ReportingThreadHandle1.Join(); } if (ReportingThreadHandle2 != null) { ReportingThreadHandle2.Join(); } if (DownloadThreadHandle != null) { DownloadThreadHandle.Join(); } if (LocalPackagesHandle != null) { LocalPackagesHandle.Join(); } StopDownloads(); PushMain0.StopPushThread(); PushMain1.StopPushThread(); PushMain2.StopPushThread(); #if ENABLECHAT PushMain10.StopPushThread(); #endif UpdateCheck.StopUpdateThread(); DownloadSystemFSData.StopThread(); FoxEventLog.VerboseWriteEventLog("StopAllThreads() - Done", System.Diagnostics.EventLogEntryType.Information); }