This repository has been archived on 2021-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
PF3/hw1/Ex5/src/main/java/reentrantrwlock/WatcherSimulation.java

21 lines
374 B
Java

package reentrantrwlock;
public class WatcherSimulation implements Runnable {
private final MovieCatalog myCatalog;
public WatcherSimulation(MovieCatalog myCatalog) {
this.myCatalog = myCatalog;
}
public void run() {
Movie movie = myCatalog.getRandomMovie();
try {
movie.play();
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
}