Skip to content
Permalink
Browse files

Fixed typo and missing MANAGED characteristic

  • Loading branch information
AlanBateman committed Nov 15, 2019
1 parent 54ef494 commit b27af9e802e827ae751c7b5acaac2e930b232f3f
Showing with 22 additions and 3 deletions.
  1. +22 −3 src/java.base/share/classes/java/lang/Thread.java
@@ -709,6 +709,12 @@ public static Builder builder() {
*/
Builder priority(int priority);

/**
* The thread is <em>managed.</em>
* @return this builder
*/
Builder managed();

/**
* Sets the target object for the thread to run.
* @param target the target object
@@ -852,6 +858,12 @@ public Builder priority(int priority) {
return this;
}

@Override
public Builder managed() {
// TDB
return this;
}

@Override
public Thread build() {
Runnable target = this.target;
@@ -1337,8 +1349,15 @@ public Thread(ThreadGroup group, Runnable target, String name,
*/
public static final int INHERIT_THREAD_LOCALS = 1 << 2;

/**
* Characteristic value signifying that the thread is <em>managed.</em>
*
* @since 99
*/
public static final int MANAGED = 1 << 3;

private static int validCharacteristics() {
return (LIGHTWEIGHT | NO_THREAD_LOCALS | INHERIT_THREAD_LOCALS);
return (LIGHTWEIGHT | NO_THREAD_LOCALS | INHERIT_THREAD_LOCALS | MANAGED);
}

private static void checkCharacteristics(int characteristics) {
@@ -1356,7 +1375,7 @@ private static void checkCharacteristics(int characteristics) {
*
* By default, the thread is scheduled by the operating system, supports
* {@link ThreadLocal thread-locals}, and does not inherit any initial values
* for {@link InheritableThreadLocal inhertiable-thread-locals}.
* for {@link InheritableThreadLocal inheritable-thread-locals}.
* The {@link ThreadGroup ThreadGroup}, {@link #isDaemon() daemon status},
* {@link #getPriority() priority}, and the {@link #getContextClassLoader()
* context-class-loader} are inherited from the current thread.
@@ -1388,7 +1407,7 @@ public static Thread newThread(int characteristics, Runnable target) {
*
* By default, the thread is scheduled by the operating system, supports
* {@link ThreadLocal thread-locals}, and does not inherit any initial values
* for {@link InheritableThreadLocal inhertiable-thread-locals}.
* for {@link InheritableThreadLocal inheritable-thread-locals}.
* The {@link ThreadGroup ThreadGroup}, {@link #isDaemon() daemon status},
* {@link #getPriority() priority}, and the {@link #getContextClassLoader()
* context-class-loader} are inherited from the current thread.

0 comments on commit b27af9e

Please sign in to comment.
You can’t perform that action at this time.