From 8f965c2cb2bae80bd64346712739852e7bb07086 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Tue, 16 Aug 2016 17:59:22 +0200 Subject: [PATCH] windows: prevent system sleep while mining --- ccminer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ccminer.cpp b/ccminer.cpp index 8480db1..067642d 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -3761,6 +3761,8 @@ int main(int argc, char *argv[]) } SetPriorityClass(GetCurrentProcess(), prio); } + // Prevent windows to sleep while mining + SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED); #endif if (opt_affinity != -1) { if (!opt_quiet)