亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

java - The main thread exits without the child thread ending
typecho
typecho 2017-06-12 09:21:01
0
2
1237

A bug occurred when running a program today, that is, a sub-thread task executed by the main function was launched before it was completed. However, after adding sleep() to the main program, the sub-thread will execute normally and be launched (but it will not work if the sleep time is too short). The debug sub-thread is mainly stuck on the line of code that performs database operations (maybe because it is more time-consuming, and the main thread has no time to wait for you to finish...).


##

typecho
typecho

Following the voice in heart.

reply all(2)
小葫蘆

Check whether your child thread is set setDaemon(true), Jvm will exit in the following situations:

  1. When all running threads are daemon threads

  2. or when no non-daemon thread is running

巴扎黑

There is no parent-child relationship between threads. If you need to wait, you can consider the join() method. Reference:
/a/11...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template