Ticket #870 (closed defect: wontfix)

Opened 6 years ago

Last modified 3 years ago

Improve the thread whitelist in LegacyPlugin

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej-2.0.0
Component: Legacy Compatibility Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1011

Description

Some threads in IJ1 do not terminate until windows close (such as StackWindow and it's zSelector thread). There may be other cases where threads do not terminate. This will require updates to LegacyPlugin's whitelist() method.

In StackWindow's zSelector case the thread is named so we can easily identify it. But using a name could cause problems if any other plugin names a thread "zSelector". So we should come up with a way to identify threads by class names.

Ideally a Thread implementation has a class name that is enhanced if it has an anonymous override of run(). Or if someone instead gives the Thread a Runnable then perhaps the Runnable too will have an enhanced class name. We can use these enhanced names to safely identify which threads to whitelist.

Change History

comment:1 Changed 6 years ago by bdezonia

Have not found a way to find enhanced names. Running this:

System.out.println("---"+thread.getClass().getDeclaringClass());
System.out.println("---"+thread.getClass().getEnclosingClass());
System.out.println("---"+thread.getClass().getCanonicalName());
System.out.println("---"+thread.getClass().getName());
System.out.println("---"+thread.getClass().getSimpleName());
System.out.println("---"+thread.getClass().getClass());
System.out.println("---"+thread.getClass().getInterfaces());

on the zSelector thread yields this:

---null
---null
---java.lang.Thread
---java.lang.Thread
---Thread
---class java.lang.Class
---[Ljava.lang.Class;@1813ed0e

No enhanced names shown.

comment:2 Changed 6 years ago by curtis

  • Blocking 1011 added

comment:3 Changed 5 years ago by bdezonia

  • Milestone changed from imagej-2.0.0-beta3 to imagej-2.0.0-beta4

comment:4 Changed 5 years ago by bdezonia

  • Milestone changed from imagej-2.0.0-beta4 to imagej-2.0.0

comment:5 Changed 3 years ago by curtis

  • Status changed from new to closed
  • Resolution set to wontfix

We are no longer supporting use of ImageJ 1.x commands from modern ImageJ2 UIs. So this ticket is now moot.

Note: See TracTickets for help on using tickets.