< prev index next >

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

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this
--- 1,7 ---
  /*
!  * Copyright (c) 1994, 2025, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this

*** 188,12 ***
   *   <tbody>
   *   <tr>
   *     <th scope="row">
   *       {@systemProperty jdk.virtualThreadScheduler.parallelism}
   *     </th>
!  *     <td> The number of platform threads available for scheduling virtual
!  *       threads. It defaults to the number of available processors. </td>
   *   </tr>
   *   <tr>
   *     <th scope="row">
   *       {@systemProperty jdk.virtualThreadScheduler.maxPoolSize}
   *     </th>
--- 188,12 ---
   *   <tbody>
   *   <tr>
   *     <th scope="row">
   *       {@systemProperty jdk.virtualThreadScheduler.parallelism}
   *     </th>
!  *     <td> The scheduler's target parallelism. It defaults to the number of
!  *       available processors. </td>
   *   </tr>
   *   <tr>
   *     <th scope="row">
   *       {@systemProperty jdk.virtualThreadScheduler.maxPoolSize}
   *     </th>

*** 1407,20 ***
                  throw new IllegalThreadStateException();
              setThreadContainer(container);
  
              // start thread
              boolean started = false;
!             container.onStart(this);  // may throw
              try {
                  // scoped values may be inherited
                  inheritScopedValueBindings(container);
  
                  start0();
                  started = true;
              } finally {
                  if (!started) {
!                     container.onExit(this);
                  }
              }
          }
      }
  
--- 1407,20 ---
                  throw new IllegalThreadStateException();
              setThreadContainer(container);
  
              // start thread
              boolean started = false;
!             container.add(this);  // may throw
              try {
                  // scoped values may be inherited
                  inheritScopedValueBindings(container);
  
                  start0();
                  started = true;
              } finally {
                  if (!started) {
!                     container.remove(this);
                  }
              }
          }
      }
  

*** 1485,11 ***
              }
          } finally {
              // notify container that thread is exiting
              ThreadContainer container = threadContainer();
              if (container != null) {
!                 container.onExit(this);
              }
          }
  
          try {
              if (threadLocals != null && TerminatingThreadLocal.REGISTRY.isPresent()) {
--- 1485,11 ---
              }
          } finally {
              // notify container that thread is exiting
              ThreadContainer container = threadContainer();
              if (container != null) {
!                 container.remove(this);
              }
          }
  
          try {
              if (threadLocals != null && TerminatingThreadLocal.REGISTRY.isPresent()) {
< prev index next >