Aborting a thread that runs GH_Document.NewSolution

I am running into some issues with the state of a GH_Document after running GH_Document.NewSolution on a separate thread and then aborting that thread while the solution is being computed. What’s the recommended way to reset the status of the GH_Document such that the next call to GH_Document.NewSolution will compute a fresh solution?
Interestingly the expireAllObjects parameter of GH_Document.NewSolution doesn’t do the trick, neither does calling GH_Document.ExpireSolution() beforehand.
After aborting the thread the value of GH_Document.SolutionState is GH_ProcessStep.Process.

Is aborting the thread a bad idea in general, and is there a better way to abort the computation of a new solution immediately?

Maybe compute.rhino3d wasn’t the best choice for this thread, please let me know.

@stevebaer would you have a hint?

Yes, aborting a thread is a bad idea. I believe this was even removed from .NET 5 and .NET 6.

I would recommend trying to call GH_Document.RequestAbortSolution() to let the solution gracefully exit.

Many thanks for your feedback @stevebaer !