我有一个Gui应用程序,可以在串行热敏打印机上打印票据.当我点击启动此操作的按钮时,我的GUI被冻结.我认为那是因为代码是在EDT上执行的.我使用jstack确定但我不理解下面的结果:
Full thread dump Java HotSpot(TM) Client VM (23.3-b01 mixed mode, sharing):
"Thread-12" prio=6 tid=0x03012000 nid=0xd04 runnable [0x038ef000]
java.lang.Thread.State: RUNNABLE
at gnu.io.RXTXPort.eventLoop(Native Method)
at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575)
"Thread-6" prio=6 tid=0x0302c400 nid=0x1b0 waiting on condition [0x039ef000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at posO2.Threads.ThreadHorloge.run(ThreadHorloge.java:46)
"Thread-5" prio=6 tid=0x03511c00 nid=0x9e4 waiting on condition [0x0399f000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at posO2.Threads.ThreadIgor.run(ThreadIgor.java:29)
"Thread-7" prio=6 tid=0x034b9800 nid=0xb40 waiting on condition [0x0394f000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at posO2.Threads.ThreadHorloge.run(ThreadHorloge.java:46)
at java.lang.Thread.run(Unknown Source)
"Thread-4" prio=6 tid=0x0318ec00 nid=0xa08 …Run Code Online (Sandbox Code Playgroud)