mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 20:22:39 +08:00
[Java] Fix bug of BaseID in multi-threading case. (#4974)
This commit is contained in:
@@ -41,13 +41,14 @@ public abstract class BaseId implements Serializable {
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user