vineflower icon indicating copy to clipboard operation
vineflower copied to clipboard

Replace Thread.stop with cancellation

Open Earthcomputer opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe.

ClassWrapper uses Thread.stop to implement method decompilation time limits, which is deprecated for removal. It also creates a new thread per method.

Describe the solution you'd like

Since we now have CancelationManager, and its checkCanceled method is called regularly, we could modify CancelationManager to support the concept of a time limit and remove the threading entirely.

Additional context

Take note of CancelationManager.cancelationChecker when modifying CancelationManager, setCancelationChecker is (or at least will be) called by the intellij plugin for its own cancelation requests. When canceled by vineflower-intellij, the entire decompilation process should be canceled and not just a single method, so it might be worth storing the type of the cancelation in CancelationException.

Earthcomputer avatar Nov 02 '24 17:11 Earthcomputer