< prev index next >

src/java.base/share/classes/java/lang/InheritableThreadLocal.java

Print this page
@@ -22,11 +22,10 @@
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   */
  
  package java.lang;
- import java.lang.ref.*;
  
  /**
   * This class extends {@code ThreadLocal} to provide inheritance of values
   * from parent thread to child thread: when a child thread is created, the
   * child receives initial values for all inheritable thread-local variables

@@ -46,10 +45,11 @@
   * thread-local variables.
   *
   * @author  Josh Bloch and Doug Lea
   * @see     ThreadLocal
   * @since   1.2
+  * @see Thread.Builder#inheritInheritableThreadLocals(boolean)
   */
  
  public class InheritableThreadLocal<T> extends ThreadLocal<T> {
      /**
       * Creates an inheritable thread local variable.

@@ -75,19 +75,21 @@
      /**
       * Get the map associated with a ThreadLocal.
       *
       * @param t the current thread
       */
+     @Override
      ThreadLocalMap getMap(Thread t) {
-        return t.inheritableThreadLocals;
+         return t.inheritableThreadLocals;
      }
  
      /**
       * Create the map associated with a ThreadLocal.
       *
       * @param t the current thread
       * @param firstValue value for the initial entry of the table.
       */
+     @Override
      void createMap(Thread t, T firstValue) {
          t.inheritableThreadLocals = new ThreadLocalMap(this, firstValue);
      }
  }
< prev index next >