One way would be to increment a variable every time a thread is created, and decrement it whenever a thread terminates. When it reaches zero again, close the whole process.
一种解决方法是增加一个变量,每创建一个新的线程该变量就加1,每终止一个线程该变量就减1,当该变量再次为零时,就关闭整个进程。
One way would be to increment a variable every time a thread is created, and decrement it whenever a thread terminates. When it reaches zero again, close the whole process.
一种解决方法是增加一个变量,每创建一个新的线程该变量就加1,每终止一个线程该变量就减1,当该变量再次为零时,就关闭整个进程。
应用推荐