如何在JavaWebStart启动的JavaFX应用程序中阻止AWT线程?

时间:2018-08-13 11:38:22

标签: java multithreading swing javafx appkit

我有一个应用程序,当我从IDE中运行它并进行线程转储时,看不到AWT线程。但是,当我从jnlp文件启动时,我看到三个:

Dump thread list ...
Group system,ac=29,agc=3,pri=10
    Reference Handler,10,alive,daemon
    Finalizer,8,alive,daemon
    Signal Dispatcher,9,alive,daemon
    AWT-Shutdown,5,alive
    Java2D Queue Flusher,10,alive,daemon
    Java2D Disposer,10,alive,daemon
    Prism Font Disposer,10,alive,daemon
    process reaper,10,alive,daemon
Group main,ac=5,agc=0,pri=10
    JavaFX Application Thread,5,alive,daemon
    traceMsgQueueThread,5,alive,daemon
    AWT-EventQueue-0,6,alive
    DestroyJavaVM,5,alive
    Thread-19,5,alive,daemon
Group javawsSecurityThreadGroup,ac=8,agc=0,pri=10
    Javaws Secure Thread,5,alive,daemon
    AWT-EventQueue-1,6,alive
    ConsoleTraceListener,5,alive,daemon
    MemoryCache-DelayedCleanup,5,alive,daemon
    CacheMemoryCleanUpThread,5,alive,daemon
    CacheCleanUpThread,5,alive,daemon
    Image Fetcher 0,8,alive,daemon
    TimerQueue,5,alive,daemon
Group javawsApplicationThreadGroup,ac=8,agc=0,pri=10
    ProgressReporter,5,alive,daemon
    javawsApplicationMain,5,alive
    AWT-EventQueue-2,6,alive
    JavaFX-Launcher,5,alive
    QuantumRenderer-0,5,alive,daemon
    Thread-18,5,alive,daemon
    EventSystem,5,alive,daemon
    pool-4-thread-1,5,alive
Done.

我尝试调度一个Runnable来查找那些线程并中断它们(首先中断AWT-Shutdown),但是似乎总是剩下一个EventQueue,加上Shutdown,这也许是“容忍”的中断? >

我注意到com.sun.javaws.Launcher中有一堆与AWT相关的东西,我想这是启动这些线程的原因。

由于this related issue I posted,我试图摆脱它们,即使我的应用程序根本不依赖任何AWT代码,在AWT和AppKit之间进行线程连接时,我也会发生致命崩溃。

0 个答案:

没有答案