¿ª·¢»·¾³£¨IDE£©ÄܸøͼÐνçÃæÓ¦ÓóÌÐòÌṩһ¸öºÜºÃµÄµ÷ÊÔ¹¤¾ß£¬µ«ÊÇËüÈ´²»Äܵ÷ÊÔÒ»¸ö¶àÏ̵߳ÄJava·þÎñÆ÷³ÌÐò¡£
ÐÒÔ˵ÄÊÇ£¬Óм¸ÖÖ¹¤¾ß£¬ÀýÈçloggingÓ¦ÓóÌÐò½Ó¿Ú£¨API£©»òÕßJava Debugger¿ÉÒÔÓÃÀ´µ÷ÊÔJava·þÎñÆ÷³ÌÐò¡£¿ª·¢Õß»¹ÄÜʹÓÃÒ»¸öϵͳµÄÏ̶߳ÑÔÚÈκÎʱºò¹Û²ìϵͳµÄ״̬¡£
ÔËÐзþÎñÆ÷£¬È»ºó°´[ctrl] [/]£¬»áÔËÐÐÒ»¸öϵͳÏ̶߳ѣ¬ÕâÑù½«Êä³öµ±Ç°ÔËÐеÄËùÓÐỊ̈߳¬ÀýÈ磺
^\Full thread dump:
Thread-1" prio=5 tid=0x87fe0 nid=0x800013b8 waiting on monitor [0..0xbfffe9f8]
"Thread-0" prio=5 tid=0xafde0 nid=0x72a00 runnable [0x173f000..0x173fb48]
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:421)
at java.net.ServerSocket.implAccept(ServerSocket.java:243)
at java.net.ServerSocket.accept(ServerSocket.java:222)
at com.generationjava.net.PortListener.run(PortListener.java:38)
at java.lang.Thread.run(Thread.java:496)
"Signal Dispatcher" daemon prio=10 tid=0xa5f80 nid=0x52af0 waiting on monitor [0..0]
"Finalizer" daemon prio=8 tid=0xa46c0 nid=0x4d930 waiting on monitor [0x10a8000..0x10a8b48]
at java.lang.Object.wait(Native Method)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162)
"Reference Handler" daemon prio=10 tid=0xa3b70 nid=0x4cca0 waiting on monitor [0x1027000..0x1027b48]
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:420)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110)
"VM Thread" prio=5 tid=0xa2de0 nid=0x4ca20 runnable
"VM Periodic Task Thread" prio=10 tid=0xa56b0 nid=0x52890 waiting on monitor
ºóÃæµÄËĸöÏß³ÌÊDZê×¼Ị̈߳¬¶øÆäËûµÄÔò¸úÔËÐеķþÎñÆ÷³ÌÐòÓйء£ÕâÁ½¸öÏ̱߳»ÃüÃûΪThread-1ºÍThread-0£¬Èç¹ûÓÃThread th = new Thread(runnable,"Server")´úÌæThread th = new Thread(runnable)È¥´´½¨½ø³Ì£¬Äã¾Í¿ÉÒÔÃüÃû×Ô¼ºÒª´´½¨µÄÏ̡߳£
ÁíÍ⣬Èç¹ûÄãµ÷ÓÃjava.lang.ThreadµÄsetName(String)·½·¨£¬ÄãÒ²ÄÜÃüÃûÄãµÄỊ̈߳¬²¢ÇÒ¿ÉÒÔºÜÈÝÒ×´ÓÏ̶߳ѵÄÊä³öÖз¢ÏÖÔÀ´µÄThread-0ÊÇ·þÎñÆ÷³ÌÐò¡£
"Server" prio=5 tid=0xafde0 nid=0x72a00 runnable [0x173f000..0x173fb48]
¶øÔÀ´µÄThread-1Ïß³ÌÏÖÔÚ±ä³ÉÁËThread-0¡£
ͨ¹ýÃüÃûÏ̺߳ÍÈ¡µÃÏ̶߳ѣ¬¿ª·¢Õß¾ÍÄÜ¿´µ½JavaÐéÄâ»ú£¨JVM£©µÄÄÚ²¿×´Ì¬¡£Èç¹ûÏëµÃµ½¸ü¶àÐÅÏ¢µÄ»°£¬Äã¾ÍµÃÈ¥Ñо¿Java DebuggerÁË¡£