JUC锁: 锁核心类AQS详解

前几天已经总结过AQS的相关知识点。但是总感觉学的不够扎实,今天根据网上的blog在此进行总结。

什么是AQS、为什么它是核心?

AQS是用来构造锁和同步器的框架,中文队列同步器。在java中有很多的同步器都是由AQS作为基础核心的。比如:ReentrantLock、Semaphore等等。程序员也可以自己利用AQS定义符合自己需求的同步器。

AQS的和核心思想?底层数据结构是什么?

核心思想:

**宏观:**AQS的核心思想是,如果一个线程正在请求一个空闲的共享资源,那么AQS则将当前线程设置为有效地工作线程,并且将共享资源设置为锁定状态。当线程请求的共享资源呈现锁定状态,这说明此资源正在被其他线程使用,那么AQS提供了基于CLH虚拟双端队列的线程等待和唤醒操作,即将暂时获取不到锁的线程资源放入队列尾,进行自旋等待。

底层数据结构:

image

这张图是在网上的blog上拿下来的,跟java并发编程艺术这本书上稍稍有些出入,书中并没有提到Condition Queue这个数据结构。Condition queue这是属于Condition的内容。此处进行了结合。

AQS的底层数据结构主要是使用的CLH虚拟双向队列,队列中保存了节点之间的关系。AQS将每条请求共享资源的线程封装成队列的节点结构Node,如果请求锁失败则加入队列的尾部,并实现节点的自旋操作。如果当前节点的前驱结点是首(头)节点,并且其获取锁成功,则此时释放首节点,阻塞其他线程的请求。

上图中的Condition Queue只有在使用了Condition的时候才会存在。

从源码角度分析AQS底层:
public abstract class AbstractQueuedSynchronizer extends AbstractOwnableSynchronizer implements java.io.Serializable

AbstractQueuedSynchronizer继承自AbstractOwnableSynchronizer抽象类,并且实现了Serializable接口,可以进行序列化。

AQS源代码中主要包括两个内部类——Node、ConditionObject类

内部类Node
static final class Node {// 模式,分为共享与独占// 共享模式static final Node SHARED = new Node();// 独占模式static final Node EXCLUSIVE = null;        // 结点状态// CANCELLED,值为1,表示当前的线程被取消// SIGNAL,值为-1,表示当前节点的后继节点包含的线程需要运行,也就是unpark// CONDITION,值为-2,表示当前节点在等待condition,也就是在condition队列中// PROPAGATE,值为-3,表示当前场景下后续的acquireShared能够得以执行// 值为0,表示当前节点在sync队列中,等待着获取锁static final int CANCELLED =  1;static final int SIGNAL    = -1;static final int CONDITION = -2;static final int PROPAGATE = -3;        // 结点状态volatile int waitStatus;        // 前驱结点volatile Node prev;    // 后继结点volatile Node next;        // 结点所对应的线程volatile Thread thread;        // 下一个等待者Node nextWaiter;// 结点是否在共享模式下等待final boolean isShared() {return nextWaiter == SHARED;}// 获取前驱结点,若前驱结点为空,抛出异常final Node predecessor() throws NullPointerException {// 保存前驱结点Node p = prev; if (p == null) // 前驱结点为空,抛出异常throw new NullPointerException();else // 前驱结点不为空,返回return p;}// 无参构造方法Node() {    // Used to establish initial head or SHARED marker}// 构造方法Node(Thread thread, Node mode) {    // Used by addWaiterthis.nextWaiter = mode;this.thread = thread;}// 构造方法Node(Thread thread, int waitStatus) { // Used by Conditionthis.waitStatus = waitStatus;this.thread = thread;}
}
内部类ConditionObject类:
// 内部类
public class ConditionObject implements Condition, java.io.Serializable {// 版本号private static final long serialVersionUID = 1173984872572414699L;/** First node of condition queue. */// condition队列的头结点private transient Node firstWaiter;/** Last node of condition queue. */// condition队列的尾结点private transient Node lastWaiter;/*** Creates a new {@code ConditionObject} instance.*/// 构造方法public ConditionObject() { }// Internal methods/*** Adds a new waiter to wait queue.* @return its new wait node*/// 添加新的waiter到wait队列private Node addConditionWaiter() {// 保存尾结点Node t = lastWaiter;// If lastWaiter is cancelled, clean out.if (t != null && t.waitStatus != Node.CONDITION) { // 尾结点不为空,并且尾结点的状态不为CONDITION// 清除状态为CONDITION的结点unlinkCancelledWaiters(); // 将最后一个结点重新赋值给tt = lastWaiter;}// 新建一个结点Node node = new Node(Thread.currentThread(), Node.CONDITION);if (t == null) // 尾结点为空// 设置condition队列的头结点firstWaiter = node;else // 尾结点不为空// 设置为节点的nextWaiter域为node结点t.nextWaiter = node;// 更新condition队列的尾结点lastWaiter = node;return node;}/*** Removes and transfers nodes until hit non-cancelled one or* null. Split out from signal in part to encourage compilers* to inline the case of no waiters.* @param first (non-null) the first node on condition queue*/private void doSignal(Node first) {// 循环do {if ( (firstWaiter = first.nextWaiter) == null) // 该节点的nextWaiter为空// 设置尾结点为空lastWaiter = null;// 设置first结点的nextWaiter域first.nextWaiter = null;} while (!transferForSignal(first) &&(first = firstWaiter) != null); // 将结点从condition队列转移到sync队列失败并且condition队列中的头结点不为空,一直循环}/*** Removes and transfers all nodes.* @param first (non-null) the first node on condition queue*/private void doSignalAll(Node first) {// condition队列的头结点尾结点都设置为空lastWaiter = firstWaiter = null;// 循环do {// 获取first结点的nextWaiter域结点Node next = first.nextWaiter;// 设置first结点的nextWaiter域为空first.nextWaiter = null;// 将first结点从condition队列转移到sync队列transferForSignal(first);// 重新设置firstfirst = next;} while (first != null);}/*** Unlinks cancelled waiter nodes from condition queue.* Called only while holding lock. This is called when* cancellation occurred during condition wait, and upon* insertion of a new waiter when lastWaiter is seen to have* been cancelled. This method is needed to avoid garbage* retention in the absence of signals. So even though it may* require a full traversal, it comes into play only when* timeouts or cancellations occur in the absence of* signals. It traverses all nodes rather than stopping at a* particular target to unlink all pointers to garbage nodes* without requiring many re-traversals during cancellation* storms.*/// 从condition队列中清除状态为CANCEL的结点private void unlinkCancelledWaiters() {// 保存condition队列头结点Node t = firstWaiter;Node trail = null;while (t != null) { // t不为空// 下一个结点Node next = t.nextWaiter;if (t.waitStatus != Node.CONDITION) { // t结点的状态不为CONDTION状态// 设置t节点的额nextWaiter域为空t.nextWaiter = null;if (trail == null) // trail为空// 重新设置condition队列的头结点firstWaiter = next;else // trail不为空// 设置trail结点的nextWaiter域为next结点trail.nextWaiter = next;if (next == null) // next结点为空// 设置condition队列的尾结点lastWaiter = trail;}else // t结点的状态为CONDTION状态// 设置trail结点trail = t;// 设置t结点t = next;}}// public methods/*** Moves the longest-waiting thread, if one exists, from the* wait queue for this condition to the wait queue for the* owning lock.** @throws IllegalMonitorStateException if {@link #isHeldExclusively}*         returns {@code false}*/// 唤醒一个等待线程。如果所有的线程都在等待此条件,则选择其中的一个唤醒。在从 await 返回之前,该线程必须重新获取锁。public final void signal() {if (!isHeldExclusively()) // 不被当前线程独占,抛出异常throw new IllegalMonitorStateException();// 保存condition队列头结点Node first = firstWaiter;if (first != null) // 头结点不为空// 唤醒一个等待线程doSignal(first);}/*** Moves all threads from the wait queue for this condition to* the wait queue for the owning lock.** @throws IllegalMonitorStateException if {@link #isHeldExclusively}*         returns {@code false}*/// 唤醒所有等待线程。如果所有的线程都在等待此条件,则唤醒所有线程。在从 await 返回之前,每个线程都必须重新获取锁。public final void signalAll() {if (!isHeldExclusively()) // 不被当前线程独占,抛出异常throw new IllegalMonitorStateException();// 保存condition队列头结点Node first = firstWaiter;if (first != null) // 头结点不为空// 唤醒所有等待线程doSignalAll(first);}/*** Implements uninterruptible condition wait.* <ol>* <li> Save lock state returned by {@link #getState}.* <li> Invoke {@link #release} with saved state as argument,*      throwing IllegalMonitorStateException if it fails.* <li> Block until signalled.* <li> Reacquire by invoking specialized version of*      {@link #acquire} with saved state as argument.* </ol>*/// 等待,当前线程在接到信号之前一直处于等待状态,不响应中断public final void awaitUninterruptibly() {// 添加一个结点到等待队列Node node = addConditionWaiter();// 获取释放的状态int savedState = fullyRelease(node);boolean interrupted = false;while (!isOnSyncQueue(node)) { // // 阻塞当前线程LockSupport.park(this);if (Thread.interrupted()) // 当前线程被中断// 设置interrupted状态interrupted = true; }if (acquireQueued(node, savedState) || interrupted) // selfInterrupt();}/** For interruptible waits, we need to track whether to throw* InterruptedException, if interrupted while blocked on* condition, versus reinterrupt current thread, if* interrupted while blocked waiting to re-acquire.*//** Mode meaning to reinterrupt on exit from wait */private static final int REINTERRUPT =  1;/** Mode meaning to throw InterruptedException on exit from wait */private static final int THROW_IE    = -1;/*** Checks for interrupt, returning THROW_IE if interrupted* before signalled, REINTERRUPT if after signalled, or* 0 if not interrupted.*/private int checkInterruptWhileWaiting(Node node) {return Thread.interrupted() ?(transferAfterCancelledWait(node) ? THROW_IE : REINTERRUPT) :0; }/*** Throws InterruptedException, reinterrupts current thread, or* does nothing, depending on mode.*/private void reportInterruptAfterWait(int interruptMode)throws InterruptedException {if (interruptMode == THROW_IE)throw new InterruptedException();else if (interruptMode == REINTERRUPT)selfInterrupt();}/*** Implements interruptible condition wait.* <ol>* <li> If current thread is interrupted, throw InterruptedException.* <li> Save lock state returned by {@link #getState}.* <li> Invoke {@link #release} with saved state as argument,*      throwing IllegalMonitorStateException if it fails.* <li> Block until signalled or interrupted.* <li> Reacquire by invoking specialized version of*      {@link #acquire} with saved state as argument.* <li> If interrupted while blocked in step 4, throw InterruptedException.* </ol>*/// // 等待,当前线程在接到信号或被中断之前一直处于等待状态public final void await() throws InterruptedException {if (Thread.interrupted()) // 当前线程被中断,抛出异常throw new InterruptedException();// 在wait队列上添加一个结点Node node = addConditionWaiter();// int savedState = fullyRelease(node);int interruptMode = 0;while (!isOnSyncQueue(node)) {// 阻塞当前线程LockSupport.park(this);if ((interruptMode = checkInterruptWhileWaiting(node)) != 0) // 检查结点等待时的中断类型break;}if (acquireQueued(node, savedState) && interruptMode != THROW_IE)interruptMode = REINTERRUPT;if (node.nextWaiter != null) // clean up if cancelledunlinkCancelledWaiters();if (interruptMode != 0)reportInterruptAfterWait(interruptMode);}/*** Implements timed condition wait.* <ol>* <li> If current thread is interrupted, throw InterruptedException.* <li> Save lock state returned by {@link #getState}.* <li> Invoke {@link #release} with saved state as argument,*      throwing IllegalMonitorStateException if it fails.* <li> Block until signalled, interrupted, or timed out.* <li> Reacquire by invoking specialized version of*      {@link #acquire} with saved state as argument.* <li> If interrupted while blocked in step 4, throw InterruptedException.* </ol>*/// 等待,当前线程在接到信号、被中断或到达指定等待时间之前一直处于等待状态 public final long awaitNanos(long nanosTimeout)throws InterruptedException {if (Thread.interrupted())throw new InterruptedException();Node node = addConditionWaiter();int savedState = fullyRelease(node);final long deadline = System.nanoTime() + nanosTimeout;int interruptMode = 0;while (!isOnSyncQueue(node)) {if (nanosTimeout <= 0L) {transferAfterCancelledWait(node);break;}if (nanosTimeout >= spinForTimeoutThreshold)LockSupport.parkNanos(this, nanosTimeout);if ((interruptMode = checkInterruptWhileWaiting(node)) != 0)break;nanosTimeout = deadline - System.nanoTime();}if (acquireQueued(node, savedState) && interruptMode != THROW_IE)interruptMode = REINTERRUPT;if (node.nextWaiter != null)unlinkCancelledWaiters();if (interruptMode != 0)reportInterruptAfterWait(interruptMode);return deadline - System.nanoTime();}/*** Implements absolute timed condition wait.* <ol>* <li> If current thread is interrupted, throw InterruptedException.* <li> Save lock state returned by {@link #getState}.* <li> Invoke {@link #release} with saved state as argument,*      throwing IllegalMonitorStateException if it fails.* <li> Block until signalled, interrupted, or timed out.* <li> Reacquire by invoking specialized version of*      {@link #acquire} with saved state as argument.* <li> If interrupted while blocked in step 4, throw InterruptedException.* <li> If timed out while blocked in step 4, return false, else true.* </ol>*/// 等待,当前线程在接到信号、被中断或到达指定最后期限之前一直处于等待状态public final boolean awaitUntil(Date deadline)throws InterruptedException {long abstime = deadline.getTime();if (Thread.interrupted())throw new InterruptedException();Node node = addConditionWaiter();int savedState = fullyRelease(node);boolean timedout = false;int interruptMode = 0;while (!isOnSyncQueue(node)) {if (System.currentTimeMillis() > abstime) {timedout = transferAfterCancelledWait(node);break;}LockSupport.parkUntil(this, abstime);if ((interruptMode = checkInterruptWhileWaiting(node)) != 0)break;}if (acquireQueued(node, savedState) && interruptMode != THROW_IE)interruptMode = REINTERRUPT;if (node.nextWaiter != null)unlinkCancelledWaiters();if (interruptMode != 0)reportInterruptAfterWait(interruptMode);return !timedout;}/*** Implements timed condition wait.* <ol>* <li> If current thread is interrupted, throw InterruptedException.* <li> Save lock state returned by {@link #getState}.* <li> Invoke {@link #release} with saved state as argument,*      throwing IllegalMonitorStateException if it fails.* <li> Block until signalled, interrupted, or timed out.* <li> Reacquire by invoking specialized version of*      {@link #acquire} with saved state as argument.* <li> If interrupted while blocked in step 4, throw InterruptedException.* <li> If timed out while blocked in step 4, return false, else true.* </ol>*/// 等待,当前线程在接到信号、被中断或到达指定等待时间之前一直处于等待状态。此方法在行为上等效于: awaitNanos(unit.toNanos(time)) > 0public final boolean await(long time, TimeUnit unit)throws InterruptedException {long nanosTimeout = unit.toNanos(time);if (Thread.interrupted())throw new InterruptedException();Node node = addConditionWaiter();int savedState = fullyRelease(node);final long deadline = System.nanoTime() + nanosTimeout;boolean timedout = false;int interruptMode = 0;while (!isOnSyncQueue(node)) {if (nanosTimeout <= 0L) {timedout = transferAfterCancelledWait(node);break;}if (nanosTimeout >= spinForTimeoutThreshold)LockSupport.parkNanos(this, nanosTimeout);if ((interruptMode = checkInterruptWhileWaiting(node)) != 0)break;nanosTimeout = deadline - System.nanoTime();}if (acquireQueued(node, savedState) && interruptMode != THROW_IE)interruptMode = REINTERRUPT;if (node.nextWaiter != null)unlinkCancelledWaiters();if (interruptMode != 0)reportInterruptAfterWait(interruptMode);return !timedout;}//  support for instrumentation/*** Returns true if this condition was created by the given* synchronization object.** @return {@code true} if owned*/final boolean isOwnedBy(AbstractQueuedSynchronizer sync) {return sync == AbstractQueuedSynchronizer.this;}/*** Queries whether any threads are waiting on this condition.* Implements {@link AbstractQueuedSynchronizer#hasWaiters(ConditionObject)}.** @return {@code true} if there are any waiting threads* @throws IllegalMonitorStateException if {@link #isHeldExclusively}*         returns {@code false}*///  查询是否有正在等待此条件的任何线程protected final boolean hasWaiters() {if (!isHeldExclusively())throw new IllegalMonitorStateException();for (Node w = firstWaiter; w != null; w = w.nextWaiter) {if (w.waitStatus == Node.CONDITION)return true;}return false;}/*** Returns an estimate of the number of threads waiting on* this condition.* Implements {@link AbstractQueuedSynchronizer#getWaitQueueLength(ConditionObject)}.** @return the estimated number of waiting threads* @throws IllegalMonitorStateException if {@link #isHeldExclusively}*         returns {@code false}*/// 返回正在等待此条件的线程数估计值protected final int getWaitQueueLength() {if (!isHeldExclusively())throw new IllegalMonitorStateException();int n = 0;for (Node w = firstWaiter; w != null; w = w.nextWaiter) {if (w.waitStatus == Node.CONDITION)++n;}return n;}/*** Returns a collection containing those threads that may be* waiting on this Condition.* Implements {@link AbstractQueuedSynchronizer#getWaitingThreads(ConditionObject)}.** @return the collection of threads* @throws IllegalMonitorStateException if {@link #isHeldExclusively}*         returns {@code false}*/// 返回包含那些可能正在等待此条件的线程集合protected final Collection<Thread> getWaitingThreads() {if (!isHeldExclusively())throw new IllegalMonitorStateException();ArrayList<Thread> list = new ArrayList<Thread>();for (Node w = firstWaiter; w != null; w = w.nextWaiter) {if (w.waitStatus == Node.CONDITION) {Thread t = w.thread;if (t != null)list.add(t);}}return list;}
}

Condition的具体实现另做分析。不在本片文章中叙述。

AQS类的属性
public abstract class AbstractQueuedSynchronizer extends AbstractOwnableSynchronizerimplements java.io.Serializable {    // 版本号private static final long serialVersionUID = 7373984972572414691L;    // 头结点private transient volatile Node head;    // 尾结点private transient volatile Node tail;    // 状态private volatile int state;    // 自旋时间static final long spinForTimeoutThreshold = 1000L;// Unsafe类实例private static final Unsafe unsafe = Unsafe.getUnsafe();// state内存偏移地址private static final long stateOffset;// head内存偏移地址private static final long headOffset;// state内存偏移地址private static final long tailOffset;// tail内存偏移地址private static final long waitStatusOffset;// next内存偏移地址private static final long nextOffset;// 静态初始化块 加载内存的偏移地址static {try {stateOffset = unsafe.objectFieldOffset(AbstractQueuedSynchronizer.class.getDeclaredField("state"));headOffset = unsafe.objectFieldOffset(AbstractQueuedSynchronizer.class.getDeclaredField("head"));tailOffset = unsafe.objectFieldOffset(AbstractQueuedSynchronizer.class.getDeclaredField("tail"));waitStatusOffset = unsafe.objectFieldOffset(Node.class.getDeclaredField("waitStatus"));nextOffset = unsafe.objectFieldOffset(Node.class.getDeclaredField("next"));} catch (Exception ex) { throw new Error(ex); }}
}

AQS有哪些核心的方法?

AQS中的核心方法在原理上来说就是获取锁和释放锁,但是AQS的获取资源的方式分为独占和共享,所以有两套方法,这里我们先看独占系列的核心方法。

acquire方法

该方法以独占的方式获取资源,此方法对于线程中断不敏感,也就是说线程中断对此方法无效。

public final void acquire(int arg) {if (!tryAcquire(arg) && acquireQueued(addWaiter(Node.EXCLUSIVE), arg))selfInterrupt();
}

image

接下来我们一次看顺序调用的方法:

tryAcquire方法

调用此方法的线程将会在独占模式下获取对象的状态,如果获取成功,则后续语句将不会执行,因为是&&操作符。如果此方法调用失败,表示当前尝试获取的对象资源已经被其他线程占用,那么将会执行后续方法。

addWaiter()方法

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-C3nE1BF6-1600644095337)(C:\Users\30914\AppData\Roaming\Typora\typora-user-images\image-20200907214736976.png)]

/*** Creates and enqueues node for current thread and given mode.** @param mode Node.EXCLUSIVE for exclusive, Node.SHARED for shared* @return the new node*///添加等待节点private Node addWaiter(Node mode) {//根据当前线程的模式和线程的基本信息构造Node节点Node node = new Node(Thread.currentThread(), mode);// Try the fast path of enq; backup to full enq on failureNode pred = tail;//插入尾节点 注意CAS的使用if (pred != null) {node.prev = pred;if (compareAndSetTail(pred, node)) {pred.next = node;return node;}}//如果尾节点没有被初始化,则进入end方法死循环添加节点,知道添加成功enq(node);return node;}

enq()方法

private Node enq(final Node node) {for (;;) {Node t = tail;if (t == null) { // Must initialize//如果没有初始化,则先初始化if (compareAndSetHead(new Node()))tail = head;} else {//已经初始化,则直接CAS添加node至尾节点。node.prev = t;if (compareAndSetTail(t, node)) {t.next = node;return t;}}}}

以上这两个方法都在致力于添加线程节点值队列尾部,再添加的过程中,都使用了CAS操作来保证原子性,如果尾节点初始化失败或者CAS再执行的时候出现问题,则调用死循环方法enq,其内部也使用了CAS来添加尾节点,当添加成功后,返回,跳出死循环。

acquireQueued()方法

final boolean acquireQueued(final Node node, int arg) {// 标志boolean failed = true;try {// 中断标志boolean interrupted = false;for (;;) { // 无限循环// 获取node节点的前驱结点final Node p = node.predecessor(); if (p == head && tryAcquire(arg)) { // 前驱为头结点并且成功获得锁setHead(node); // 设置头结点p.next = null; // help GCfailed = false; // 设置标志return interrupted; }if (shouldParkAfterFailedAcquire(p, node) &&parkAndCheckInterrupt())interrupted = true;}} finally {if (failed)cancelAcquire(node);}
}

当线程被构造成Node节点并添加至队列尾之后,节点并不是什么都不做,或者说java会对其采取动作。这个动作叫自旋,也就是节点不断通过某种方式检测自己是否获得了锁,是否可以执行对应的线程活动。

该方法对应的主要流程为:

  • 检查自己的前驱节点是不是头节点,如果是头节点,那么尝试获取锁,如果获取成功,则将当前节点设置为头节点,并断开之前的头节点之间连接,进行GC操作。

  • 无论这一步是否成功,程序最终都会调用finally代码块中的代码:

  • 如果上述操作失败,则会执行shouldParkAfterFailedAcquireparkAndCheckInterrupt方法,一起来看源码:

    • // 当获取(资源)失败后,检查并且更新结点状态
      private static boolean shouldParkAfterFailedAcquire(Node pred, Node node) {// 获取前驱结点的状态int ws = pred.waitStatus;if (ws == Node.SIGNAL) // 状态为SIGNAL,为-1/** This node has already set status asking a release* to signal it, so it can safely park.*/// 可以进行park操作return true; if (ws > 0) { // 表示状态为CANCELLED,为1/** Predecessor was cancelled. Skip over predecessors and* indicate retry.*/do {node.prev = pred = pred.prev;} while (pred.waitStatus > 0); // 找到pred结点前面最近的一个状态不为CANCELLED的结点// 赋值pred结点的next域pred.next = node; } else { // 为PROPAGATE -3 或者是0 表示无状态,(为CONDITION -2时,表示此节点在condition queue中) /** waitStatus must be 0 or PROPAGATE.  Indicate that we* need a signal, but don't park yet.  Caller will need to* retry to make sure it cannot acquire before parking.*/// 比较并设置前驱结点的状态为SIGNALcompareAndSetWaitStatus(pred, ws, Node.SIGNAL); }// 不能进行park操作return false;
      } 
      
    • 这个源码的目的是,在线程节点自旋的过程中,判断当前正在执行的线程是否需要阻塞。判断的规则如下:

      • 如果当前线程的前驱结点的状态是SINNAL,则表明当前线程需要阻塞。直接返回true。
      • 如果ws>0,则表明前驱结点状态为CANCELLED,说明此时前驱结点已经超时等待或者被中断了,则需要将这种前驱节点从CLH队列中删除。
      • 如果ws为其他状态值,则通过CAS的方式将前驱结点设置为SINNAL,返回false。
      • 综上,只有当前节点的前驱结点的状态值为SINNAL的时候,才对当前线程进行阻塞。
  • 阻塞代码:

    • private final boolean parkAndCheckInterrupt() {LockSupport.park(this);return Thread.interrupted();}
      
    • shouldParkAfterFailedAcquire方法返回为true,表示当前节点需要阻塞,则调用LockSupport的park方法阻塞当前线程。

release方法:

public final boolean release(int arg) {if (tryRelease(arg)) { // 释放成功// 保存头结点Node h = head; if (h != null && h.waitStatus != 0) // 头结点不为空并且头结点状态不为0unparkSuccessor(h); //释放头结点的后继结点return true;}return false;
}

前驱结点的状态是SINNAL,则表明当前线程需要阻塞。直接返回true。
- 如果ws>0,则表明前驱结点状态为CANCELLED,说明此时前驱结点已经超时等待或者被中断了,则需要将这种前驱节点从CLH队列中删除。
- 如果ws为其他状态值,则通过CAS的方式将前驱结点设置为SINNAL,返回false。
- 综上,只有当前节点的前驱结点的状态值为SINNAL的时候,才对当前线程进行阻塞。

  • 阻塞代码:

    • private final boolean parkAndCheckInterrupt() {LockSupport.park(this);return Thread.interrupted();}
      
    • shouldParkAfterFailedAcquire方法返回为true,表示当前节点需要阻塞,则调用LockSupport的park方法阻塞当前线程。

release方法:

public final boolean release(int arg) {if (tryRelease(arg)) { // 释放成功// 保存头结点Node h = head; if (h != null && h.waitStatus != 0) // 头结点不为空并且头结点状态不为0unparkSuccessor(h); //释放头结点的后继结点return true;}return false;
}
查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. 基础

    ...

    2024/4/21 14:35:24
  2. Redis 之二:配置文件

    0 主从配置文件引用。 # include /path/to/local.conf # include /path/to/other.conf 1 daemonize no 是否后台运行&#xff0c;默认redis不是在后台运行的&#xff0c;一般启动会改为yes。 2 pidfile var/lib/redis/6379/run/redis.pid 进程文件及路径设置。当Redis在…...

    2024/4/22 5:40:35
  3. 《自然语言处理实战入门》NLP 可视化 ---- 词向量可视化

    文章大纲 词向量简介t-SNE 可视化tensorboard 可视化参考文献《自然语言处理实战入门》NLP可视化---- python可视化初步 matplotlib 相关设置 《自然语言处理实战入门》NLP 可视化 ---- 文本分析基础 《自然语言处理实战入门》NLP 可视化 ---- 文本内容可视化 词向量简介 比…...

    2024/4/9 16:44:33
  4. ROS自平衡车案例学习(机器人操作系统+现代控制理论融合)

    之前&#xff0c;现代控制理论&#xff0c;研究过一些倒立摆和自平衡小车&#xff0c;现在用ROSGazebo环境尝试一下。 ROS自平衡机器人仿真&#xff08;机器人操作系统现代控制理论融合案例&#xff09;找了一些案例都是kinetic&#xff0c;Gazebo7及以前的版本适用。为了能使m…...

    2024/4/24 1:33:22
  5. 动态规划的本质

    我的原文地址&#xff1a;https://mp.weixin.qq.com/s/axMa0IxjYfIr18jFjYbyUg涛歌依旧CSDN认证博客专家涛哥挺nice的...

    2024/4/23 9:51:29
  6. 回忆当年高考的一道数学证明题

    我的原文地址&#xff1a;https://mp.weixin.qq.com/s/bWEpMP-UVECbUa5D2jAjhA涛歌依旧CSDN认证博客专家涛哥挺nice的...

    2024/4/10 11:45:33
  7. 第一次遇到http code 413---上传文件太大被nginx拒绝

    第一次遇到http code 413, 返回内容如下&#xff1a; <head><title>413 Request Entity Too Large</title></head> <body> <center><h1>413 Request Entity Too Large</h1></center> <hr><center>nginx<…...

    2024/4/25 20:18:02
  8. JVM 从入门到精通(六)JVM运行时数据区——虚拟机栈

    写在前面:我是「云祁」,一枚热爱技术、会写诗的大数据开发猿。昵称来源于王安石诗中一句 [ 云之祁祁,或雨于渊 ] ,甚是喜欢。 写博客一方面是对自己学习的一点点总结及记录,另一方面则是希望能够帮助更多对大数据感兴趣的朋友。如果你也对 数据中台、数据建模、数据分析以…...

    2024/4/18 1:49:21
  9. 深度学习算法原理——LSTM

    1. 概述 在循环神经网络RNN一文中提及到了循环神经网络RNN存在长距离依赖的问题&#xff0c;长短期记忆&#xff08;Long Short-Term Memory&#xff0c;LSTM&#xff09;网络便是为了解决RNN中存在的梯度爆炸的问题而提出。在LSTM网络中&#xff0c;主要依靠引入“门”机制来…...

    2024/4/12 12:21:29
  10. ReentrantLock 超时锁2

    本文需要前置知识&#xff0c;请参阅 ReentrantLock 解决锁分析 1 文章目录例子例子 ReentrantLock reentrantLock new ReentrantLock(false);new Thread(new Runnable() {Overridepublic void run() {reentrantLock.lock();}}).start();//保证子线程已经加锁TimeUnit.SECONDS…...

    2024/4/26 12:17:24
  11. 行人重识别github开源库——HJL-re-id

    目录 一、简介 二、实现的Re-ID模型 三、MDRS 四、遮挡的行人重识别 项目地址&#xff1a;https://github.com/nickhuang1996/HJL-re-id 一、简介 这是由博主自己完成的行人重识别代码库&#xff0c;包含了博主自己研究的MDRS模型。 该项目包含对日志记录、损失监测和可…...

    2024/4/9 19:03:09
  12. 一个技术同学22岁生日的一些思考与小总结。

    反思 人总是愿意去反思&#xff0c;反思过往是否做得足够好&#xff0c;是否在某些事情上做得欠缺考虑。这一年&#xff0c;从开始的新奇与怀揣不安到最后的习惯与坚持想法&#xff0c;于我个人来说&#xff0c;是成长。我能为公司带来什么&#xff0c;或者说公司为什么要雇用…...

    2024/4/24 19:18:33
  13. 【数据挖掘 13】4个必备 Python AutoML 库

    文章目录1. auto-sklearn2.TPOT3. HyperOpt4. AutoKeras如何选择自动化机器学习&#xff08;AutoML&#xff09;是一个新兴领域&#xff0c;在该领域中&#xff0c;建立机器学习模型以建模数据的过程是自动化的。AutoML使每个人都能更轻松地进行建模。 1. auto-sklearn auto-…...

    2024/4/10 7:06:29
  14. 【项目实战】——历史数据归档

    迁移目标 按季度(每个租户自定义季度日期且各不相同)划分&#xff0c;有明显的冷热数据区分&#xff0c;目标将冷数据分隔&#xff0c;减少单表过大&#xff0c;提供SQL等业务处理能力&#xff0c;期待预期按租户自定义时间迁移&#xff0c;且迁移过程实现自动化&#xff0c;无…...

    2024/4/21 12:54:17
  15. Python 中 scipy 包拟合分布函数 fit 的不足

    最近使用 scipy 包中的 fit 函数拟合随机分布&#xff0c;发现它得出的参数怪怪的&#xff0c; KS 检验的结果也与其他软件&#xff08;R语言&#xff0c;EasyFit&#xff09;的结果不一样。 例如&#xff0c;有时候明明一个随机分布拟合的很好&#xff0c;但 ks 检验的 p 值却…...

    2024/4/12 5:25:49
  16. [会议分享]2020全球软件大会分享-PWA在项目中的最佳实践

    大会地址&#xff1a;https://www.bagevent.com/event/1233659#...

    2024/4/26 16:31:04
  17. 架构师修炼系列【架构重构】

    系统的架构是不断演化的&#xff0c;少部分架构演化可能需要推倒重来进行重写&#xff0c;但大部分的架构演化都是通过架构重构来实现的&#xff0c;相比全新的架构设计来说&#xff0c;架构重构对架构师的要求更高&#xff0c;主要体现在&#xff1a; 业务己经上线&#xff0…...

    2024/4/10 6:30:11
  18. 啃Docker之必备基础管理操作

    啃Docker之必备基础管理操作前言一&#xff1a;环境准备二&#xff1a;镜像的常规操作三&#xff1a;容器的常规操作前言 对于理论可以看我之前的博客 链接: https://blog.csdn.net/m0_47219942/article/details/108684100. 一&#xff1a;环境准备 关闭防火墙和核心防护 […...

    2024/4/10 6:29:36
  19. 怎样在扶贫采购上用关键词搜索商品并批量下载主图

    今天小编要介绍的是&#xff0c;怎样从扶贫采购上用关键词搜索到自己想要的商品&#xff0c;并一次性批量下载到多个商品主图&#xff0c;然后保存到同一个目录。下面我们就用载图助手来实例操作&#xff0c;一起来看看吧。 要一次批量下载多个商品&#xff0c;为了方便复制商…...

    2024/4/17 17:49:47
  20. 机器学习 之 贝叶斯法

    占坑...

    2024/4/22 6:39:28

最新文章

  1. Fluent.Ribbon创建Office的RibbonWindow菜单

    链接&#xff1a; Fluent.Ribbon文档 优势&#xff1a; 1. 可以创建类似Office办公软件的复杂窗口&#xff1b; 2. 可以应用自定义主题风格界面...

    2024/4/26 16:42:10
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/3/20 10:50:27
  3. 第十三届蓝桥杯大赛软件赛省赛C/C++ 大学 B 组 题解

    VP比赛链接 : 数据加载中... - 蓝桥云课 1 . 九进制 转 十进制 直接模拟就好了 #include <iostream> using namespace std; int main() {// 请在此输入您的代码int x 22*92*81*9;cout << x << endl ;return 0; } 2 . 顺子日期 枚举出每个情况即可 : …...

    2024/4/23 6:37:37
  4. Java深度优先搜索DFS(含面试大厂题和源码)

    深度优先搜索&#xff08;Depth-First Search&#xff0c;简称DFS&#xff09;是一种用于遍历或搜索树或图的算法。DFS 通过沿着树的深度来遍历节点&#xff0c;尽可能深地搜索树的分支。当节点v的所在边都已被探寻过&#xff0c;搜索将回溯到发现节点v的那条边的起始节点。这个…...

    2024/4/23 6:13:06
  5. 416. 分割等和子集问题(动态规划)

    题目 题解 class Solution:def canPartition(self, nums: List[int]) -> bool:# badcaseif not nums:return True# 不能被2整除if sum(nums) % 2 ! 0:return False# 状态定义&#xff1a;dp[i][j]表示当背包容量为j&#xff0c;用前i个物品是否正好可以将背包填满&#xff…...

    2024/4/26 1:36:40
  6. 【Java】ExcelWriter自适应宽度工具类(支持中文)

    工具类 import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet;/*** Excel工具类** author xiaoming* date 2023/11/17 10:40*/ public class ExcelUti…...

    2024/4/25 21:14:51
  7. Spring cloud负载均衡@LoadBalanced LoadBalancerClient

    LoadBalance vs Ribbon 由于Spring cloud2020之后移除了Ribbon&#xff0c;直接使用Spring Cloud LoadBalancer作为客户端负载均衡组件&#xff0c;我们讨论Spring负载均衡以Spring Cloud2020之后版本为主&#xff0c;学习Spring Cloud LoadBalance&#xff0c;暂不讨论Ribbon…...

    2024/4/26 8:22:40
  8. TSINGSEE青犀AI智能分析+视频监控工业园区周界安全防范方案

    一、背景需求分析 在工业产业园、化工园或生产制造园区中&#xff0c;周界防范意义重大&#xff0c;对园区的安全起到重要的作用。常规的安防方式是采用人员巡查&#xff0c;人力投入成本大而且效率低。周界一旦被破坏或入侵&#xff0c;会影响园区人员和资产安全&#xff0c;…...

    2024/4/26 11:10:01
  9. VB.net WebBrowser网页元素抓取分析方法

    在用WebBrowser编程实现网页操作自动化时&#xff0c;常要分析网页Html&#xff0c;例如网页在加载数据时&#xff0c;常会显示“系统处理中&#xff0c;请稍候..”&#xff0c;我们需要在数据加载完成后才能继续下一步操作&#xff0c;如何抓取这个信息的网页html元素变化&…...

    2024/4/25 16:50:01
  10. 【Objective-C】Objective-C汇总

    方法定义 参考&#xff1a;https://www.yiibai.com/objective_c/objective_c_functions.html Objective-C编程语言中方法定义的一般形式如下 - (return_type) method_name:( argumentType1 )argumentName1 joiningArgument2:( argumentType2 )argumentName2 ... joiningArgu…...

    2024/4/25 13:02:58
  11. 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】

    &#x1f468;‍&#x1f4bb;博客主页&#xff1a;花无缺 欢迎 点赞&#x1f44d; 收藏⭐ 留言&#x1f4dd; 加关注✅! 本文由 花无缺 原创 收录于专栏 【洛谷算法题】 文章目录 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】&#x1f30f;题目描述&#x1f30f;输入格…...

    2024/4/26 0:25:04
  12. 【ES6.0】- 扩展运算符(...)

    【ES6.0】- 扩展运算符... 文章目录 【ES6.0】- 扩展运算符...一、概述二、拷贝数组对象三、合并操作四、参数传递五、数组去重六、字符串转字符数组七、NodeList转数组八、解构变量九、打印日志十、总结 一、概述 **扩展运算符(...)**允许一个表达式在期望多个参数&#xff0…...

    2024/4/26 6:06:14
  13. 摩根看好的前智能硬件头部品牌双11交易数据极度异常!——是模式创新还是饮鸩止渴?

    文 | 螳螂观察 作者 | 李燃 双11狂欢已落下帷幕&#xff0c;各大品牌纷纷晒出优异的成绩单&#xff0c;摩根士丹利投资的智能硬件头部品牌凯迪仕也不例外。然而有爆料称&#xff0c;在自媒体平台发布霸榜各大榜单喜讯的凯迪仕智能锁&#xff0c;多个平台数据都表现出极度异常…...

    2024/4/25 17:43:17
  14. Go语言常用命令详解(二)

    文章目录 前言常用命令go bug示例参数说明 go doc示例参数说明 go env示例 go fix示例 go fmt示例 go generate示例 总结写在最后 前言 接着上一篇继续介绍Go语言的常用命令 常用命令 以下是一些常用的Go命令&#xff0c;这些命令可以帮助您在Go开发中进行编译、测试、运行和…...

    2024/4/25 17:43:00
  15. 用欧拉路径判断图同构推出reverse合法性:1116T4

    http://cplusoj.com/d/senior/p/SS231116D 假设我们要把 a a a 变成 b b b&#xff0c;我们在 a i a_i ai​ 和 a i 1 a_{i1} ai1​ 之间连边&#xff0c; b b b 同理&#xff0c;则 a a a 能变成 b b b 的充要条件是两图 A , B A,B A,B 同构。 必要性显然&#xff0…...

    2024/4/25 13:00:31
  16. 【NGINX--1】基础知识

    1、在 Debian/Ubuntu 上安装 NGINX 在 Debian 或 Ubuntu 机器上安装 NGINX 开源版。 更新已配置源的软件包信息&#xff0c;并安装一些有助于配置官方 NGINX 软件包仓库的软件包&#xff1a; apt-get update apt install -y curl gnupg2 ca-certificates lsb-release debian-…...

    2024/4/25 17:42:40
  17. Hive默认分割符、存储格式与数据压缩

    目录 1、Hive默认分割符2、Hive存储格式3、Hive数据压缩 1、Hive默认分割符 Hive创建表时指定的行受限&#xff08;ROW FORMAT&#xff09;配置标准HQL为&#xff1a; ... ROW FORMAT DELIMITED FIELDS TERMINATED BY \u0001 COLLECTION ITEMS TERMINATED BY , MAP KEYS TERMI…...

    2024/4/26 9:43:47
  18. 【论文阅读】MAG:一种用于航天器遥测数据中有效异常检测的新方法

    文章目录 摘要1 引言2 问题描述3 拟议框架4 所提出方法的细节A.数据预处理B.变量相关分析C.MAG模型D.异常分数 5 实验A.数据集和性能指标B.实验设置与平台C.结果和比较 6 结论 摘要 异常检测是保证航天器稳定性的关键。在航天器运行过程中&#xff0c;传感器和控制器产生大量周…...

    2024/4/26 9:43:47
  19. --max-old-space-size=8192报错

    vue项目运行时&#xff0c;如果经常运行慢&#xff0c;崩溃停止服务&#xff0c;报如下错误 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 因为在 Node 中&#xff0c;通过JavaScript使用内存时只能使用部分内存&#xff08;64位系统&…...

    2024/4/25 13:40:45
  20. 基于深度学习的恶意软件检测

    恶意软件是指恶意软件犯罪者用来感染个人计算机或整个组织的网络的软件。 它利用目标系统漏洞&#xff0c;例如可以被劫持的合法软件&#xff08;例如浏览器或 Web 应用程序插件&#xff09;中的错误。 恶意软件渗透可能会造成灾难性的后果&#xff0c;包括数据被盗、勒索或网…...

    2024/4/25 13:01:30
  21. JS原型对象prototype

    让我简单的为大家介绍一下原型对象prototype吧&#xff01; 使用原型实现方法共享 1.构造函数通过原型分配的函数是所有对象所 共享的。 2.JavaScript 规定&#xff0c;每一个构造函数都有一个 prototype 属性&#xff0c;指向另一个对象&#xff0c;所以我们也称为原型对象…...

    2024/4/25 15:31:26
  22. C++中只能有一个实例的单例类

    C中只能有一个实例的单例类 前面讨论的 President 类很不错&#xff0c;但存在一个缺陷&#xff1a;无法禁止通过实例化多个对象来创建多名总统&#xff1a; President One, Two, Three; 由于复制构造函数是私有的&#xff0c;其中每个对象都是不可复制的&#xff0c;但您的目…...

    2024/4/25 17:31:15
  23. python django 小程序图书借阅源码

    开发工具&#xff1a; PyCharm&#xff0c;mysql5.7&#xff0c;微信开发者工具 技术说明&#xff1a; python django html 小程序 功能介绍&#xff1a; 用户端&#xff1a; 登录注册&#xff08;含授权登录&#xff09; 首页显示搜索图书&#xff0c;轮播图&#xff0…...

    2024/4/25 13:22:53
  24. 电子学会C/C++编程等级考试2022年03月(一级)真题解析

    C/C++等级考试(1~8级)全部真题・点这里 第1题:双精度浮点数的输入输出 输入一个双精度浮点数,保留8位小数,输出这个浮点数。 时间限制:1000 内存限制:65536输入 只有一行,一个双精度浮点数。输出 一行,保留8位小数的浮点数。样例输入 3.1415926535798932样例输出 3.1…...

    2024/4/26 9:43:45
  25. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  26. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  27. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  28. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  29. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  30. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  31. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  32. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  33. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  34. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  35. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  36. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  37. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  38. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  39. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  40. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  41. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  42. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  43. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  44. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57