< prev index next >
src/java.base/share/classes/java/lang/Thread.java
Print this page
*** 1224,1234 ****
throw new NullPointerException("name cannot be null");
}
this.name = name;
if (threadStatus != 0) {
! setNativeName(name);
}
}
/**
* Returns this thread's name.
--- 1224,1235 ----
throw new NullPointerException("name cannot be null");
}
this.name = name;
if (threadStatus != 0) {
! // Don't modify JNI-attached threads
! setNativeName(name, false);
}
}
/**
* Returns this thread's name.
*** 2140,2146 ****
private native void setPriority0(int newPriority);
private native void stop0(Object o);
private native void suspend0();
private native void resume0();
private native void interrupt0();
! private native void setNativeName(String name);
}
--- 2141,2150 ----
private native void setPriority0(int newPriority);
private native void stop0(Object o);
private native void suspend0();
private native void resume0();
private native void interrupt0();
!
! // May be called directly via JNI or reflection (when permitted) to
! // allow JNI-attached threads to set their native name
! private native void setNativeName(String name, boolean allowAttachedThread);
}
< prev index next >