在java JRE中我看到了代码
private final ReentrantLock lock;
public E poll() {
final ReentrantLock lock = this.lock;
lock.lock();
为什么锁定被捕获到私有变量?我希望简单
public E poll() {
lock.lock();
在java JRE中我看到了代码
private final ReentrantLock lock;
public E poll() {
final ReentrantLock lock = this.lock;
lock.lock();
为什么锁定被捕获到私有变量?我希望简单
public E poll() {
lock.lock();