MCPcopy Create free account
hub / github.com/Tencent/tgfx / Make

Method Make

src/platform/android/HandlerThread.cpp:39–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39std::shared_ptr<HandlerThread> HandlerThread::Make() {
40 JNIEnvironment environment;
41 auto env = environment.current();
42 if (env == nullptr) {
43 return nullptr;
44 }
45 auto name = env->NewStringUTF("tgfx_HandlerThread");
46 auto thread = env->NewObject(HandlerThreadClass.get(), HandlerThread_Constructor, name);
47 env->CallVoidMethod(thread, HandlerThread_start);
48 if (env->ExceptionCheck()) {
49 env->ExceptionClear();
50 LOGE("HandlerThread::Make(): failed to start the HandlerThread!");
51 return nullptr;
52 }
53 return std::make_shared<HandlerThread>(env, thread);
54}
55
56HandlerThread::HandlerThread(JNIEnv* env, jobject handlerThread) {
57 thread = handlerThread;

Callers

nothing calls this directly

Calls 2

currentMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected