Who interrupts my thread?

后端 未结 3 1068
一生所求
一生所求 2020-12-17 16:42

I understand what an InterruptedException does and why it is thrown. However in my application I get it when waiting for SwingUtilities.invokeAndWait() on a thr

3条回答
  •  抹茶落季
    2020-12-17 17:04

    There is something strange here.

    From the javadoc of invokeAndWait, an InterruptedException is thrown

    if we're interrupted while waiting for the event dispatching thread to finish excecuting doRun.run()

    Have you tried to see if the code executed in the EDT sends any exception ? Or do the code in that EDT tries to modify some of this thread's variables (I know this term is not "orthodox" in java language, but I hope you see what I mean : any code implying synchronized, wait, join, ...

提交回复
热议问题