Commit 4739de9a by Patryk Czarnik

Poprawki przykładów nt wątków

parent a01f61a9
......@@ -21,6 +21,7 @@ public class PuleWatkow {
System.out.println("Zaczynam zlecać...");
for(int i = 0; i < N; i++) {
pool.submit(zadanie);
// albo od razu lambdę: pool.submit(() -> System.out.println("a kuku"));
// pool.execute(zadanie);
// pool.schedule(zadanie, 2, TimeUnit.SECONDS);
try {
......@@ -29,7 +30,7 @@ public class PuleWatkow {
}
}
System.out.println("Zlecilem wykonanie");
System.out.println("Zleciłem wykonanie");
pool.shutdown();
//pool.shutdownNow();
......
......@@ -34,7 +34,7 @@ public class Konto {
this.wlasciciel = wlasciciel;
}
public int getSaldo() {
public synchronized int getSaldo() {
return saldo;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment