gpt4 book ai didi

java - 在 UI 线程上运行 Eclipse Plugin Activator 的 .start() 方法

转载 作者:行者123 更新时间:2023-12-01 11:19:27 25 4
gpt4 key购买 nike

AbstractUIPlugin的规范声明 startup 方法不能假设它在 UI 线程上运行。 start 方法也是如此吗?

最佳答案

start 方法不适合放置 UI 代码。除此之外,在插件中的其他代码运行之前,通常不会调用它。

定义 startPlugin 的 JavaDoc 说:

This method and the stop(BundleContext) may be called from separate threads, but the OSGi framework ensures that both methods will not be called simultaneously.

这并不能真正保证 start 将在哪个线程上运行。

关于java - 在 UI 线程上运行 Eclipse Plugin Activator 的 .start() 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31431546/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com