How to know when a thread has been terminated

0

I have the following javascript ployment in the call of a Thread .

I would like to print in the log the moment the Thread was terminated. It is possible?

func4 = {
        run: function(){
            atv4();
        }
    };
    r4 = new java.lang.Runnable(func4);
    t4 = new java.lang.Thread(r4);
    t4.start();
    log.info("Iniciei a thread atv4");
    return;
    
asked by anonymous 09.03.2017 / 15:37

1 answer

1

Whenever the thread is terminated or even when an error occurs, it goes to the TERMINATED state.

if(t4.getState()!=Thread.State.TERMINATED){...}
    
09.03.2017 / 15:43