36 lines
848 B
Java
36 lines
848 B
Java
package Controller;
|
|
|
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
|
|
|
import Model.ModelData;
|
|
import Model.MyModel;
|
|
|
|
import View.MyView;
|
|
|
|
public class Main {
|
|
public static void main(String[] args) {
|
|
ConcurrentLinkedQueue<Integer> qCommands = new ConcurrentLinkedQueue<Integer>();
|
|
ConcurrentLinkedQueue<ModelData> qDataFromModel = new ConcurrentLinkedQueue<ModelData>();
|
|
|
|
Object oThreadLock = new Object();
|
|
|
|
MyModel oModel = new MyModel(oThreadLock, qDataFromModel);
|
|
|
|
ModelData oModelData = new ModelData("");
|
|
|
|
MyView oView = new MyView(oModelData);
|
|
|
|
|
|
|
|
oModel.start();
|
|
|
|
while (true) {
|
|
|
|
//Wake up model thread if new task to execute.
|
|
synchronized(oThreadLock) {
|
|
oThreadLock.notifyAll();
|
|
}
|
|
}
|
|
}
|
|
}
|