previous | start | next

Terminating a Thread

public void run(
{
   try
   {
      for (int = 1;
           i <= REPETITIONS && !isInterrupted();
           i++)
      {
         //do the work
      }
   }
   catch (InterruptedException exception)
   {
   }
   //cleanup
}


previous | start | next