bool Runtime::AttachCurrentThread(const char* thread_name, bool as_daemon, jobject thread_group,
bool create_peer) {
- bool success = Thread::Attach(thread_name, as_daemon, thread_group, create_peer) != NULL;
- if (thread_name == NULL) {
- LOG(WARNING) << *Thread::Current() << " attached without supplying a name";
- }
- return success;
+ return Thread::Attach(thread_name, as_daemon, thread_group, create_peer) != NULL;
}
void Runtime::DetachCurrentThread() {
if (thread_name != nullptr) {
self->tlsPtr_.name->assign(thread_name);
::art::SetThreadName(thread_name);
+ } else if (self->GetJniEnv()->check_jni) {
+ LOG(WARNING) << *Thread::Current() << " attached without supplying a name";
}
}