0

i'm trying to kill/stop Rengine thread but i can't, even if call end() method also. see the bellow peace of code.

Rengine engine = new Rengine(new String[] { "--no-save" }, false, null);
----
----
engine.end();
System.out.println("engine::: "+engine);

the result of sysout is

engine::: Thread[Thread-0,5,]

then how to kill my Rengine thread?

Enamul Hassan
  • 5,266
  • 23
  • 39
  • 56

1 Answers1

0

Your engine is already closed. After I call .end() on the Rengine it quits, and after that if there is no code to run the java main() exits as well normally. If I put System.out.println("engine::: "+engine); before the main() exit and after calling engine.end() I too get engine::: Thread[Thread-1,5,main].

The sysout is just printing the reference to the Rengine object that you created. E.g. if you did Rengine engine = new Rengine (new String [] {"–vanilla"}, false, null); then when you print engine after the end() call, it is just printing the reference of the engine object.

Hope this helps else read here: What is Object Reference Variable?

Community
  • 1
  • 1
Abhimanu Kumar
  • 1,751
  • 18
  • 20