leetcode 206 reverse List

This commit is contained in:
2021-02-27 23:00:47 +08:00
parent b3cd375f61
commit fbf515f1bb

View File

@@ -24,7 +24,6 @@
package io.github.ehlxr.lock; package io.github.ehlxr.lock;
import java.util.concurrent.locks.AbstractQueuedLongSynchronizer;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
/** /**
@@ -37,7 +36,12 @@ public class Locker {
public static void main(String[] args) { public static void main(String[] args) {
ReentrantLock lock = new ReentrantLock(); ReentrantLock lock = new ReentrantLock();
lock.tryLock(); lock.lock(); // block until condition holds
try {
// ... method body
} finally {
lock.unlock();
}
} }
} }