Skip to content

Commit

Permalink
8271624: Avoid unnecessary ThreadGroup.checkAccess calls when creatin…
Browse files Browse the repository at this point in the history
…g Threads

Reviewed-by: rriggs
  • Loading branch information
cl4es committed Aug 2, 2021
1 parent e621cff commit 0b95394
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/java.base/share/classes/java/lang/Thread.java
Expand Up @@ -417,14 +417,14 @@ private Thread(ThreadGroup g, Runnable target, String name,
}
}

/* checkAccess regardless of whether or not threadgroup is
explicitly passed in. */
g.checkAccess();

/*
* Do we have the required permissions?
*/
if (security != null) {
/* checkAccess regardless of whether or not threadgroup is
explicitly passed in. */
security.checkAccess(g);

if (isCCLOverridden(getClass())) {
security.checkPermission(
SecurityConstants.SUBCLASS_IMPLEMENTATION_PERMISSION);
Expand Down

1 comment on commit 0b95394

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.