i've made something like this :
so here's my problem : i want it to notify all of the threads from all of the objects made of class2 . i thought that was the difference between notify() and notifyAll() but apparently it doesn't notify allCode:
class 1 extends Thread:
do some stuff ...
public void run :look for a client and create an instance of class2 for it if found one
class2 extends Thread:
public void run : do some stuff and notifyAll();
inner class extends thread :
public void run :
while(class2's thread isn't done yet) : wait();
do some stuff and notifyAll() again
i think it has something to do with the monitor (whatever that is) . how can i pass it along all objects and notify their threads ?
p.s. ^ is a messenger . class1 looks for sockets , class2 accepts them and sets up the stream to communicate with the client. class2's thread reads whatever i send from the client and the inner class sends every one's messages back