/** * Creates a new thread group. The parent of this new group is the specified thread group. * * <p>The <code>checkAccess</code> method of the parent thread group is called with no arguments; * this may result in a security exception. * * @param parent the parent thread group. * @param name the name of the new thread group. * @exception NullPointerException if the thread group argument is <code>null</code>. * @exception SecurityException if the current thread cannot create a thread in the specified * thread group. * @see java.lang.SecurityException * @see java.lang.ThreadGroup#checkAccess() * @since JDK1.0 */ public ThreadGroup(ThreadGroup parent, String name) { if (parent == null) { throw new NullPointerException(); } parent.checkAccess(); this.name = name; this.maxPriority = parent.maxPriority; this.daemon = parent.daemon; this.vmAllowSuspension = parent.vmAllowSuspension; this.parent = parent; parent.add(this); saveThreadStarterClassFlag = parent.saveThreadStarterClassFlag; }