I wish to know the code written inside the synchronized block but after wait() statement actually runs in synchronized way or not as during wait() lock is relinquished and once the thread is notified it again needs to take lock.
public void process(){
synchronized(sharedObj){
try{
sharedObj.wait();
}catch(InterruptedException ex){
ex.printStackTrace();
}
// when wait is over do the line below runs in synchronized way. It is inside synchronized block but during call of wait(), lock was relinquished.
sharedObj.writeValue();
}
}
Please help me clarifying my doubt.
Regards, Krishna