workMID = MY_MID;
}
+ System.out.println("Thread " + workMID + " has started");
Task localTask;
int chk;
int result;
int i,j;
- int cc;
boolean isEmpty;
while(true) {
+
atomic {
isEmpty = tasks.isTodoListEmpty(); // flag > !keep assigning
tasks.setWork(currentWorkList[workMID]);
localTask = tasks;
}
-
/* compute */
localTask.execution();
/* push into done list */
tasks.done(currentWorkList[workMID]);
currentWorkList[workMID] = null;
- cc = ((Drinker)tasks).ownTotal;
}
}
else if(chk == -1) { // finished all work