Added CPU option "yield".

This commit is contained in:
XMRig 2019-12-03 09:04:20 +07:00
parent cf48a34065
commit c3fd5835c3
No known key found for this signature in database
GPG key ID: 446A53638BE94409
7 changed files with 14 additions and 0 deletions

View file

@ -38,6 +38,7 @@ static const char *kHwAes = "hw-aes";
static const char *kMaxThreadsHint = "max-threads-hint";
static const char *kMemoryPool = "memory-pool";
static const char *kPriority = "priority";
static const char *kYield = "yield";
#ifdef XMRIG_FEATURE_ASM
static const char *kAsm = "asm";
@ -70,6 +71,7 @@ rapidjson::Value xmrig::CpuConfig::toJSON(rapidjson::Document &doc) const
obj.AddMember(StringRef(kHwAes), m_aes == AES_AUTO ? Value(kNullType) : Value(m_aes == AES_HW), allocator);
obj.AddMember(StringRef(kPriority), priority() != -1 ? Value(priority()) : Value(kNullType), allocator);
obj.AddMember(StringRef(kMemoryPool), m_memoryPool < 1 ? Value(m_memoryPool < 0) : Value(m_memoryPool), allocator);
obj.AddMember(StringRef(kYield), m_yield, allocator);
if (m_threads.isEmpty()) {
obj.AddMember(StringRef(kMaxThreadsHint), m_limit, allocator);
@ -120,6 +122,7 @@ void xmrig::CpuConfig::read(const rapidjson::Value &value)
m_enabled = Json::getBool(value, kEnabled, m_enabled);
m_hugePages = Json::getBool(value, kHugePages, m_hugePages);
m_limit = Json::getUint(value, kMaxThreadsHint, m_limit);
m_yield = Json::getBool(value, kYield, m_yield);
setAesMode(Json::getValue(value, kHwAes));
setPriority(Json::getInt(value, kPriority, -1));