src/share/classes/java/lang/ThreadGroup.java

Print this page




 901 
 902             // The thread is now a fully fledged member of the group, even
 903             // though it may, or may not, have been started yet. It will prevent
 904             // the group from being destroyed so the unstarted Threads count is
 905             // decremented.
 906             nUnstartedThreads--;
 907         }
 908     }
 909 
 910     /**
 911      * Notifies the group that the thread {@code t} has failed
 912      * an attempt to start.
 913      *
 914      * <p> The state of this thread group is rolled back as if the
 915      * attempt to start the thread has never occurred. The thread is again
 916      * considered an unstarted member of the thread group, and a subsequent
 917      * attempt to start the thread is permitted.
 918      *
 919      * @param  t
 920      *         the Thread whose start method was invoked
 921      *
 922      * @param  failed
 923      *         true if the thread could not be started successfully
 924      */
 925     void threadStartFailed(Thread t) {
 926         synchronized(this) {
 927             remove(t);
 928             nUnstartedThreads++;
 929         }
 930     }
 931 
 932     /**
 933      * Notifies the group that the thread {@code t} has terminated.
 934      *
 935      * <p> Destroy the group if all of the following conditions are
 936      * true: this is a daemon thread group; there are no more alive
 937      * or unstarted threads in the group; there are no subgroups in
 938      * this thread group.
 939      *
 940      * @param  t
 941      *         the Thread that has terminated
 942      */
 943     void threadTerminated(Thread t) {




 901 
 902             // The thread is now a fully fledged member of the group, even
 903             // though it may, or may not, have been started yet. It will prevent
 904             // the group from being destroyed so the unstarted Threads count is
 905             // decremented.
 906             nUnstartedThreads--;
 907         }
 908     }
 909 
 910     /**
 911      * Notifies the group that the thread {@code t} has failed
 912      * an attempt to start.
 913      *
 914      * <p> The state of this thread group is rolled back as if the
 915      * attempt to start the thread has never occurred. The thread is again
 916      * considered an unstarted member of the thread group, and a subsequent
 917      * attempt to start the thread is permitted.
 918      *
 919      * @param  t
 920      *         the Thread whose start method was invoked



 921      */
 922     void threadStartFailed(Thread t) {
 923         synchronized(this) {
 924             remove(t);
 925             nUnstartedThreads++;
 926         }
 927     }
 928 
 929     /**
 930      * Notifies the group that the thread {@code t} has terminated.
 931      *
 932      * <p> Destroy the group if all of the following conditions are
 933      * true: this is a daemon thread group; there are no more alive
 934      * or unstarted threads in the group; there are no subgroups in
 935      * this thread group.
 936      *
 937      * @param  t
 938      *         the Thread that has terminated
 939      */
 940     void threadTerminated(Thread t) {