[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[platform-ui-dev] Issues with calling Display.syncExec() in plugin's shutdown() method
|
Hi all,
I have been encountering difficulties in calling Display.syncExec()
within my plugin's shutdown() method. Sometimes it works and returns
from Display.syncExec(), but other times, it never returns. When this
happens, the call stack for the main Java thread is as follows:
Thread [main] (Suspended)
Object.wait(long) line: not available [native method]
RunnableLock(Object).wait() line: 426
Synchronizer.syncExec(Runnable) line: 145
Display.syncExec(Runnable) line: 2153
MyPlugin.shutdown() line: 243
PluginRegistry$2.run() line: 283
InternalPlatform.run(ISafeRunnable) line: 889
PluginRegistry$1.visit(IPluginDescriptor) line: 296
PluginRegistry.accept(IPluginVisitor, boolean) line: 55
PluginRegistry.shutdownPlugins() line: 299
PluginRegistry.shutdown(IProgressMonitor) line: 265
InternalPlatform.loaderShutdown() line: 520
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line:
not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object[]) line: 324
InternalBootLoader.shutdown() line: 979
InternalBootLoader.run(String, URL, String, String[], Runnable)
line: 850
BootLoader.run(String, URL, String, String[], Runnable) line:
461
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line:
not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
[local variables unavailable]
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
[local variables unavailable]
Method.invoke(Object, Object[]) line: 324 [local variables
unavailable]
Main.basicRun(String[]) line: 291
Main.run(String[]) line: 747
Main.main(String[]) line: 583
The only threads left running (at least on Windows) are three System
threads, in addition to the main application thread.
Is it okay to call Display.syncExec() from shutdown()? If so, is there
any way to avoid the problems that I describe above? Previously, I was
using Display.asyncExec(), but when doing this, sometimes the Runnable
was never run. If it is not okay to use Display.syncExec(), what are my
alternatives? What I would really like is some sort of preShutdown()
method in my plug-in, but shutdown() seems to be the only option.
Thanks for any help!
Aaron Levinson