docs
This commit is contained in:
parent
a95e7d6f31
commit
574ebee29c
@ -91,25 +91,24 @@ public final class MapTile extends JobTile {
|
|||||||
return state != 0;
|
return state != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if tile could be referenced by another thread
|
||||||
|
*/
|
||||||
boolean isLocked() {
|
boolean isLocked() {
|
||||||
return locked > 0 || refs > 0;
|
return locked > 0 || refs > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lock() {
|
void lock() {
|
||||||
|
if (locked++ > 0)
|
||||||
locked++;
|
|
||||||
|
|
||||||
if (locked > 1)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// lock all tiles that could serve as proxy
|
||||||
MapTile p = rel.parent.tile;
|
MapTile p = rel.parent.tile;
|
||||||
|
|
||||||
if (p != null && (p.state != 0)) {
|
if (p != null && (p.state != 0)) {
|
||||||
proxies |= PROXY_PARENT;
|
proxies |= PROXY_PARENT;
|
||||||
p.refs++;
|
p.refs++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME handle root-tile case?
|
|
||||||
p = rel.parent.parent.tile;
|
p = rel.parent.parent.tile;
|
||||||
if (p != null && (p.state != 0)) {
|
if (p != null && (p.state != 0)) {
|
||||||
proxies |= PROXY_GRAMPA;
|
proxies |= PROXY_GRAMPA;
|
||||||
@ -128,10 +127,7 @@ public final class MapTile extends JobTile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void unlock() {
|
void unlock() {
|
||||||
|
if (--locked > 0 || proxies == 0)
|
||||||
locked--;
|
|
||||||
|
|
||||||
if (locked > 0 || proxies == 0)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((proxies & PROXY_PARENT) != 0)
|
if ((proxies & PROXY_PARENT) != 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user