diff --git a/src/main/java/org/warp/commonutils/locks/LockUtils.java b/src/main/java/org/warp/commonutils/locks/LockUtils.java index dbf4dde..137149c 100644 --- a/src/main/java/org/warp/commonutils/locks/LockUtils.java +++ b/src/main/java/org/warp/commonutils/locks/LockUtils.java @@ -56,27 +56,6 @@ public class LockUtils { } } - public static void lock(@Nullable LeftRightLock lock, boolean right, @NotNull Runnable r) { - if (lock != null) { - if (right) { - lock.lockRight(); - } else { - lock.lockLeft(); - } - } - try { - r.run(); - } finally { - if (lock != null) { - if (right) { - lock.releaseRight(); - } else { - lock.releaseLeft(); - } - } - } - } - public static void lockIO(@Nullable Lock lock, @NotNull IORunnable r) throws IOException { if (lock != null) { lock.lock(); @@ -122,27 +101,6 @@ public class LockUtils { } } - public static void lockIO(@Nullable LeftRightLock lock, boolean right, @NotNull IORunnable r) throws IOException { - if (lock != null) { - if (right) { - lock.lockRight(); - } else { - lock.lockLeft(); - } - } - try { - r.run(); - } finally { - if (lock != null) { - if (right) { - lock.releaseRight(); - } else { - lock.releaseLeft(); - } - } - } - } - public static T lock(@Nullable Lock lock, @NotNull Supplier r) { if (lock != null) { lock.lock(); @@ -188,27 +146,6 @@ public class LockUtils { } } - public static T lock(@Nullable LeftRightLock lock, boolean right, @NotNull Supplier r) { - if (lock != null) { - if (right) { - lock.lockRight(); - } else { - lock.lockLeft(); - } - } - try { - return r.get(); - } finally { - if (lock != null) { - if (right) { - lock.releaseRight(); - } else { - lock.releaseLeft(); - } - } - } - } - public static T lockIO(@Nullable Lock lock, @NotNull IOSupplier r) throws IOException { if (lock != null) { lock.lock(); @@ -253,25 +190,4 @@ public class LockUtils { } } } - - public static T lockIO(@Nullable LeftRightLock lock, boolean right, @NotNull IOSupplier r) throws IOException { - if (lock != null) { - if (right) { - lock.lockRight(); - } else { - lock.lockLeft(); - } - } - try { - return r.get(); - } finally { - if (lock != null) { - if (right) { - lock.releaseRight(); - } else { - lock.releaseLeft(); - } - } - } - } }