Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60ddf9b4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix RenderThread and worker thread names used by tools"

parents 6167cf18 978d5321
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1202,12 +1202,12 @@ static const JNINativeMethod gMethods[] = {

static JavaVM* mJvm = nullptr;

static void attachRenderThreadToJvm() {
static void attachRenderThreadToJvm(const char* name) {
    LOG_ALWAYS_FATAL_IF(!mJvm, "No jvm but we set the hook??");

    JavaVMAttachArgs args;
    args.version = JNI_VERSION_1_4;
    args.name = NULL;
    args.name = name;
    args.group = NULL;
    JNIEnv* env;
    mJvm->AttachCurrentThreadAsDaemon(&env, (void*) &args);
+1 −1
Original line number Diff line number Diff line
@@ -329,7 +329,7 @@ void RenderThread::requestVsync() {
bool RenderThread::threadLoop() {
    setpriority(PRIO_PROCESS, 0, PRIORITY_DISPLAY);
    if (gOnStartHook) {
        gOnStartHook();
        gOnStartHook("RenderThread");
    }
    initThreadLocals();

+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ struct VsyncSource {

class DummyVsyncSource;

typedef void (*JVMAttachHook)();
typedef void (*JVMAttachHook)(const char* name);

class RenderThread : private ThreadBase {
    PREVENT_COPY_AND_ASSIGN(RenderThread);
+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ status_t TaskManager::WorkerThread::readyToRun() {
    setpriority(PRIO_PROCESS, 0, PRIORITY_FOREGROUND);
    auto onStartHook = renderthread::RenderThread::getOnStartHook();
    if (onStartHook) {
        onStartHook();
        onStartHook(mName.c_str());
    }

    return NO_ERROR;