Skip to content

Commit

Permalink
[Java] Fix bug of BaseID in multi-threading case. (#4974)
Browse files Browse the repository at this point in the history
  • Loading branch information
jovany-wang authored and raulchen committed Jun 13, 2019
1 parent d2f5b71 commit ef1af49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions java/api/src/main/java/org/ray/api/id/BaseId.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ public ByteBuffer toByteBuffer() {
*/
public boolean isNil() {
if (isNilCache == null) {
isNilCache = true;
boolean localIsNil = true;
for (int i = 0; i < size(); ++i) {
if (id[i] != (byte) 0xff) {
isNilCache = false;
localIsNil = false;
break;
}
}
isNilCache = localIsNil;
}
return isNilCache;
}
Expand Down

0 comments on commit ef1af49

Please sign in to comment.