PRoConEvents.MULTIbalancer.LaunchCheckForPluginUpdate C# (CSharp) Method

LaunchCheckForPluginUpdate() public method

public LaunchCheckForPluginUpdate ( ) : void
return void
        public void LaunchCheckForPluginUpdate()
        {
            try {
            double alive = 0;
            DateTime since = DateTime.MinValue;
            lock (fUpdateThreadLock) {
            alive = fUpdateThreadLock.MaxDelay; // repurpose MaxDelay to be a thread counter
            since = fUpdateThreadLock.LastUpdate;
            }
            if (alive > 0) {
            DebugWrite("Unable to check for updates, " + alive + " threads active for " + DateTime.Now.Subtract(since).TotalSeconds.ToString("F1") + " seconds!", 3);
            return;
            }

            Thread t = new Thread(new ThreadStart(CheckForPluginUpdate));
            t.IsBackground = true;
            t.Name = "updater";
            DebugWrite("Starting updater thread ...", 3);
            t.Start();
            Thread.Sleep(2);
            } catch (Exception e) {
            ConsoleException(e);
            }
        }
MULTIbalancer