Enabled keepalive for Windows (>= Vista)

This commit is contained in:
SChernykh 2023-07-17 09:49:10 +02:00
parent e7de104d88
commit 5717e72367
6 changed files with 28 additions and 6 deletions

View file

@ -49,6 +49,8 @@ public:
static inline bool isUserActive(uint64_t ms) { return idleTime() < ms; }
static inline const String &userAgent() { return m_userAgent; }
static bool hasKeepalive();
static bool isOnBatteryPower();
static uint64_t idleTime();

View file

@ -55,6 +55,12 @@ char *xmrig::Platform::createUserAgent()
}
bool xmrig::Platform::hasKeepalive()
{
return true;
}
bool xmrig::Platform::setThreadAffinity(uint64_t cpu_id)
{
return true;

View file

@ -70,6 +70,12 @@ char *xmrig::Platform::createUserAgent()
}
bool xmrig::Platform::hasKeepalive()
{
return true;
}
#ifndef XMRIG_FEATURE_HWLOC
#ifdef __DragonFly__

View file

@ -70,6 +70,12 @@ char *xmrig::Platform::createUserAgent()
}
bool xmrig::Platform::hasKeepalive()
{
return winOsVersion().dwMajorVersion >= 6;
}
#ifndef XMRIG_FEATURE_HWLOC
bool xmrig::Platform::setThreadAffinity(uint64_t cpu_id)
{