Merge "Fix RenderThread and worker thread names used by tools"
This commit is contained in:
committed by
Android (Google) Code Review
commit
60ddf9b48a
@@ -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);
|
||||
|
||||
@@ -329,7 +329,7 @@ void RenderThread::requestVsync() {
|
||||
bool RenderThread::threadLoop() {
|
||||
setpriority(PRIO_PROCESS, 0, PRIORITY_DISPLAY);
|
||||
if (gOnStartHook) {
|
||||
gOnStartHook();
|
||||
gOnStartHook("RenderThread");
|
||||
}
|
||||
initThreadLocals();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user