How to find out the servlet is demon thread

Showing Answers 1 - 1 of 1 Answers

akantilal

  • Jun 12th, 2007
 

You can use the following code to determine whether the thread in which your code is getting executed is daemon or not.

if(Thread.currentThread().isDaemon()) {
      //logic to execute if daemon.
} else {
     //logic to execute if not daemon.
}

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions