:
req.run();
synchronized (req) {
try {
req.wait(3000);
rawResponse = eq.ReturnXML;
logger.info("[" + refID + "] Response recieved: " + rawResponse);
responseRecieved = true;
req.notify();
} catch (InterruptedException ex) {
logger.error("Error waiting on req", ex);
}
}
B:
synchronized (req) {
while (!responseRecieved) {
try {
req.wait(3000);
} catch (InterruptedException ex) {
logger.error("Error waiting on req while trying to get state", ex);
}
}
}
Thread A , Thread B . , .