code: private static void checkPermission() {
          SecurityManager security = System.getSecurityManager();
          if (security != null)
              security.checkPermission(modifyThreadPermission);
      }
docs: If there is a security manager, makes sure caller has
  permission to modify threads.