Exemple #1
0
 public synchronized boolean resume() {
   if (timer == null) {
     return false;
   }
   stateSync.lock();
   try {
     startTask();
   } finally {
     stateSync.unlock();
   }
   return true;
 }
Exemple #2
0
 public synchronized boolean start() {
   if (timer != null) {
     return false;
   }
   stateSync.lock();
   try {
     timer = new Timer();
     startTask();
   } finally {
     stateSync.unlock();
   }
   return true;
 }