synchronized su awarenes e chat via tcp
This commit is contained in:
@@ -20,7 +20,7 @@ public class HelloImplemented extends UnicastRemoteObject implements HelloInterf
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(call_me_back obj) throws RemoteException {
|
||||
public synchronized void register(call_me_back obj) throws RemoteException {
|
||||
v.add(obj);
|
||||
Iterator<call_me_back> it = v.iterator();
|
||||
for (;it.hasNext();){
|
||||
@@ -30,7 +30,7 @@ public class HelloImplemented extends UnicastRemoteObject implements HelloInterf
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deregister(call_me_back obj) throws RemoteException {
|
||||
public synchronized void deregister(call_me_back obj) throws RemoteException {
|
||||
v.remove(obj);
|
||||
Iterator<call_me_back> it = v.iterator();
|
||||
for (;it.hasNext();){
|
||||
|
||||
Reference in New Issue
Block a user