public final void acquire(int arg) {if (!tryAcquire(arg) &&acquireQueued(addWaiter(Node.EXCLUSIVE), arg))selfInterrupt();} acquire方法首先判断获取锁是否成功,也就是tryAcquire方法的作用,以NonfairSync类中方法为例,下面是它的源码
问题描述 执行下列代码的时候报错如下 apt-get update && apt-get -f install 报错信息: E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) E: Unable to acquire the dpkg frontend lock (/