I have many threads running, but I want to execute a particular thread (a TimerTask’s run() method) to run to its completion and I don’t want any interruption by any other threads.
I think synchronized(this) { } wont ensure its completion.
Please suggest me a correct way to do this.
You can catch
InterruptedExceptionand setinterruptstatus once your work is completed.Noncancelable tasks