* under the terms of the license (GNU LGPL) which comes with this package.
*/
+package mutualExclusion.centralized;
import java.util.LinkedList;
-import simgrid.msg.Msg;
-import simgrid.msg.MsgException;
-import simgrid.msg.Task;
+import org.simgrid.msg.Msg;
+import org.simgrid.msg.MsgException;
+import org.simgrid.msg.Task;
+import org.simgrid.msg.Process;
-public class Coordinator extends simgrid.msg.Process {
+
+public class Coordinator extends Process {
LinkedList<RequestTask> waitingQueue=new LinkedList<RequestTask>();
int CsToServe;
GrantTask tosend = new GrantTask();
tosend.send(t.from);
} else {
- waitingQueue.push(t);
+ waitingQueue.addFirst(t);
}
} else if (task instanceof ReleaseTask) {
if (!waitingQueue.isEmpty()) {
}
}
}
-}
\ No newline at end of file
+}