jdk/src/share/classes/java/lang/ThreadGroup.java
changeset 8192 f0ee3e38944a
parent 7668 d4a77089c587
child 9035 1255eb81cc2f
equal deleted inserted replaced
8190:c8cdf811a171 8192:f0ee3e38944a
   866             nUnstartedThreads++;
   866             nUnstartedThreads++;
   867         }
   867         }
   868     }
   868     }
   869 
   869 
   870     /**
   870     /**
   871      * Notifies the group that the thread {@code t} is about to be
       
   872      * started and adds the thread to this thread group.
       
   873      *
       
   874      * The thread is now a fully fledged member of the group, even though
       
   875      * it hasn't been started yet. It will prevent the group from being
       
   876      * destroyed so the unstarted Threads count is decremented.
       
   877      */
       
   878     void threadStarting(Thread t) {
       
   879         synchronized (this) {
       
   880             add(t);
       
   881             nUnstartedThreads--;
       
   882         }
       
   883     }
       
   884 
       
   885     /**
       
   886      * Adds the specified thread to this thread group.
   871      * Adds the specified thread to this thread group.
   887      *
   872      *
   888      * <p> Note: This method is called from both library code
   873      * <p> Note: This method is called from both library code
   889      * and the Virtual Machine. It is called from VM to add
   874      * and the Virtual Machine. It is called from VM to add
   890      * certain system threads to the system thread group.
   875      * certain system threads to the system thread group.
   908             threads[nthreads] = t;
   893             threads[nthreads] = t;
   909 
   894 
   910             // This is done last so it doesn't matter in case the
   895             // This is done last so it doesn't matter in case the
   911             // thread is killed
   896             // thread is killed
   912             nthreads++;
   897             nthreads++;
       
   898 
       
   899             // The thread is now a fully fledged member of the group, even
       
   900             // though it may, or may not, have been started yet. It will prevent
       
   901             // the group from being destroyed so the unstarted Threads count is
       
   902             // decremented.
       
   903             nUnstartedThreads--;
   913         }
   904         }
   914     }
   905     }
   915 
   906 
   916     /**
   907     /**
   917      * Notifies the group that the thread {@code t} has failed
   908      * Notifies the group that the thread {@code t} has failed