leetcode 206 reverse List

dev
ehlxr 2021-02-27 23:00:47 +08:00
parent b3cd375f61
commit fbf515f1bb
1 changed files with 6 additions and 2 deletions

View File

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