This commit is contained in:
Daniel Mills
2021-08-10 07:19:17 -04:00
parent 7637905de2
commit c5c1a9b25b
4 changed files with 22 additions and 2 deletions

View File

@@ -63,6 +63,12 @@ public class HyperLock {
unlock(x, z);
}
public void withLong(long k, Runnable r) {
lock(Cache.keyX(k), Cache.keyZ(k));
r.run();
unlock(Cache.keyX(k), Cache.keyZ(k));
}
public void withNasty(int x, int z, NastyRunnable r) throws Throwable {
lock(x, z);
Throwable ee = null;