Ejemplo n.º 1
0
 private static void AccessEcSynchronized(Action <IEmbeddedController> callback, IEmbeddedController ec)
 {
     if (ec.AcquireLock(200))
     {
         try
         {
             callback(ec);
         }
         finally
         {
             ec.ReleaseLock();
         }
     }
 }
Ejemplo n.º 2
0
 private static void AccessEcSynchronized(Action <IEmbeddedController> callback, IEmbeddedController ec)
 {
     if (ec.AcquireLock(200))
     {
         try
         {
             callback(ec);
         }
         finally
         {
             ec.ReleaseLock();
         }
     }
     else
     {
         Console.Error.WriteLine("Could not acquire EC lock");
     }
 }
Ejemplo n.º 3
0
        private static void AccessEcSynchronized(Action <IEmbeddedController> callback)
        {
            var ecLoader           = new FanControlPluginLoader <IEmbeddedController>(FanControl.PluginsDirectory);
            IEmbeddedController ec = ecLoader.FanControlPlugin;

            ec.Initialize();

            if (ec.AcquireLock(200))
            {
                try
                {
                    callback(ec);
                }
                finally
                {
                    ec.ReleaseLock();
                }
            }
            else
            {
                Console.Error.WriteLine("Error connecting to Embedded Controller");
            }
        }