Galera, estou com dúvidas em relação ao syncronismo de Threads.
Vou postando alguns códigos para que agente possa discutir sobre estes exemplos, segue este 1º código.
01 public class Exerc64 extends Thread {
02
03 public void restart() {
04 startMe();
05 }
06 public static void startMe() {
07 synchronized (Exerc64.class) {
08 Exerc64.class.notifyAll();
09 System.out.println("Trying to Notify");
10 }
11 }
12 public void run() {
13 try {
14 synchronized (this) {
15 wait();
16 System.out.println("Notified");
17 }
18 } catch (InterruptedException e) { }
19 }
20 public static void main(String[] args) {
21 Exerc64 t1 = new Exerc64();
22 t1.start();
23 t1.restart();
24 }
25 }
Não consegui entender como funciona o syncronismos desta questão.
Oque foi syncronzado na linha 07 ?
Oque foi syncronzado na linha 14? O this representa a thread principal?
Qual thread foi notificada na linha 08? :?: :?: :?: :?: :?:

