We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ThreadUtils::setThreadName(...)
jni::ThreadScope
1 parent d6c9855 commit ecc8c2dCopy full SHA for ecc8c2d
packages/react-native-nitro-modules/android/src/main/cpp/platform/ThreadUtils.cpp
@@ -25,8 +25,10 @@ std::string ThreadUtils::getThreadName() {
25
}
26
27
void ThreadUtils::setThreadName(const std::string& name) {
28
- auto jName = jni::make_jstring(name);
29
- JThreadUtils::setCurrentThreadName(jName);
+ jni::ThreadScope::WithClassLoader([&]() {
+ auto jName = jni::make_jstring(name);
30
+ JThreadUtils::setCurrentThreadName(jName);
31
+ });
32
33
34
bool ThreadUtils::isUIThread() {
0 commit comments