Skip to content

Commit

Permalink
Add a note about Thread.Factory for Java 21+ users. See #7427
Browse files Browse the repository at this point in the history
RELNOTES=n/a
PiperOrigin-RevId: 685860825
  • Loading branch information
kluever authored and Google Java Core Libraries committed Oct 14, 2024
1 parent 9be5c72 commit 77243d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
* <p>If no backing thread factory is provided, a default backing thread factory is used as if by
* calling {@code setThreadFactory(}{@link Executors#defaultThreadFactory()}{@code )}.
*
* <p><b>Java 21+ users:</b> consider using the {@code Thread.Builder} interface instead. E.g.,
* instead of {@code new ThreadFactoryBuilder().setPriority(priority).setDaemon(false).build()}, use
* {@code Thread.ofPlatform().priority(priority).daemon(false).factory()}.
*
* @author Kurt Alfred Kluever
* @since 4.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
* <p>If no backing thread factory is provided, a default backing thread factory is used as if by
* calling {@code setThreadFactory(}{@link Executors#defaultThreadFactory()}{@code )}.
*
* <p><b>Java 21+ users:</b> consider using the {@code Thread.Builder} interface instead. E.g.,
* instead of {@code new ThreadFactoryBuilder().setPriority(priority).setDaemon(false).build()}, use
* {@code Thread.ofPlatform().priority(priority).daemon(false).factory()}.
*
* @author Kurt Alfred Kluever
* @since 4.0
*/
Expand Down

0 comments on commit 77243d6

Please sign in to comment.