Skip to content

Commit

Permalink
Disable NexusRevolution threads
Browse files Browse the repository at this point in the history
These threads thrashing the CPU. Disable them to save battery.
  • Loading branch information
ngoquang2708 committed Jan 14, 2025
1 parent a9c78c9 commit 36b2ff1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,21 @@ NativeThread::NativeThread() : native_handle{0} {}

NativeThread::~NativeThread() {}

void sleep_forever(void*) {
sleep(INT_MAX);
}

int NativeThread::Create(ThreadFunc func, void* arg, const ::Libraries::Kernel::PthreadAttr* attr) {
#ifndef _WIN64
pthread_t* pthr = reinterpret_cast<pthread_t*>(&native_handle);
pthread_attr_t pattr;
pthread_attr_init(&pattr);
pthread_attr_setstack(&pattr, attr->stackaddr_attr, attr->stacksize_attr);
return pthread_create(pthr, &pattr, (PthreadFunc)func, arg);
if (((Libraries::Kernel::Pthread*)arg)->name.contains("Nexus")) {
return pthread_create(pthr, &pattr, (PthreadFunc)sleep_forever, arg);
} else {
return pthread_create(pthr, &pattr, (PthreadFunc)func, arg);
}
#else
CLIENT_ID clientId{};
INITIAL_TEB teb{};
Expand Down

0 comments on commit 36b2ff1

Please sign in to comment.