comparison src/alice/topology/manager/keeparive/TaskExecuter.java @ 325:54d0b947079a

addTask method has bug.
author one
date Fri, 24 Jan 2014 01:51:14 +0900
parents 806cc010a5bd
children c382d6fe1ec4
comparison
equal deleted inserted replaced
324:806cc010a5bd 325:54d0b947079a
33 return; 33 return;
34 } 34 }
35 nowTask = list.getTaskList().poll(); 35 nowTask = list.getTaskList().poll();
36 ods.update("_WAITINGLIST", list); 36 ods.update("_WAITINGLIST", list);
37 if (skipFlag){ 37 if (skipFlag){
38 nowTask.setSleepTime(nowTask.getSleepTime() + remainingTime);
39 skipFlag = false; 38 skipFlag = false;
40 } 39 }
41 startTime = System.currentTimeMillis(); 40 startTime = System.currentTimeMillis();
42 System.out.println(nowTask.getSleepTime()+" "+nowTask.getType()); 41 System.out.println(nowTask.getSleepTime()+" "+nowTask.getType());
43 if (nowTask.getSleepTime()!=0){ 42 if (nowTask.getSleepTime()!=0){
61 setKey(); 60 setKey();
62 } 61 }
63 62
64 public synchronized void skip(){ 63 public synchronized void skip(){
65 skipFlag = true; 64 skipFlag = true;
66 remainingTime = nowTask.getSleepTime() - (System.currentTimeMillis() - startTime);
67 nowTask = null; 65 nowTask = null;
68 notify(); 66 notify();
69 } 67 }
70 68
71 public TaskInfo getNowTask(){ 69 public TaskInfo getNowTask(){
72 return nowTask; 70 return nowTask;
73 } 71 }
74 72
75 public long getTime(){ 73 public long getStartTime(){
76 return startTime; 74 return startTime;
77 } 75 }
78 76
79 public boolean compareNowTask(TaskInfo task){ 77 public boolean compareNowTask(TaskInfo task){
80 if (nowTask != null){ 78 if (nowTask != null){