jwamp
jwamp copied to clipboard
The WaitResponse.java class has a race condition
The WaitResponse.java class has a race condition:
public synchronized T call() throws Exception {
wait(waitfor);
return result;
}
The result may already have arrived before the call() method is invokded. Proposed change:
public synchronized T call() throws Exception { if (this.result == null) { wait(waitfor); } return result; }
The equivalent race in the messageoverhaul branch was in the Promise class, which I pushed a fix for yesterday (thank you for spotting that). Would you be willing to do your eval in the messageoverhaul branch? WaitResponse isn't going to be part of the library moving forward...
For a bit of history here, messageoverhaul is pretty much done (it was a major rewrite). I have gotten sidetracked with some business level things, but it will be eventually pushed back to HEAD.