< prev index next > src/java.base/share/classes/java/lang/Thread.java
Print this page
/*
- * Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved.
+ * 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
* <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>
+ * <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>
throw new IllegalThreadStateException();
setThreadContainer(container);
// start thread
boolean started = false;
- container.onStart(this); // may throw
+ container.add(this); // may throw
try {
// scoped values may be inherited
inheritScopedValueBindings(container);
start0();
started = true;
} finally {
if (!started) {
- container.onExit(this);
+ container.remove(this);
}
}
}
}
}
} finally {
// notify container that thread is exiting
ThreadContainer container = threadContainer();
if (container != null) {
- container.onExit(this);
+ container.remove(this);
}
}
try {
if (threadLocals != null && TerminatingThreadLocal.REGISTRY.isPresent()) {
< prev index next >