I have a Java Thread like the following:
public class MyThread extends Thread {
MyService service;
String id;
public MyThread(Stri
public class TopClass {
List users = new ArrayList();
void addUser(User user) {
synchronized(users) {
users.add(user);
}
}
void store() throws SQLException {
//storing code goes here
}
class MyThread extends Thread {
MyService service;
String id;
public MyThread(String id) {
this.id = node;
}
public void run() {
User user = service.getUser(id)
addUser(user);
}
}
}