public static void SetSleepStop(bool stop) { lock (lockObj) { if (stop) { sleepStopCount++; if (sleepStopCount == 1) { //Log.Write("スリープ抑止をセット"); SleepState.SetState(true); } } else { sleepStopCount--; if (sleepStopCount == 0) { SleepState.SetState(false); //Log.Write("スリープ抑止を解除"); } } } }
public static void Stop(bool flug) { object obj = SleepState.lockObj; lock (obj) { if (flug) { SleepState.count++; if (SleepState.count == 1) { SleepState.SetState(true); } } else { SleepState.count--; if (SleepState.count == 0) { SleepState.SetState(false); } } } }