进入acquireQueued方法
作者:互联网
final boolean acquireQueued(final Node node, int arg) { boolean failed = true; try { boolean interrupted = false; for (;;) { final Node p = node.predecessor(); if (p == head && tryAcquire(arg)) { setHead(node); p.next = null; // help GC failed = false; return interrupted; } if (shouldParkAfterFailedAcquire(p, node) && parkAndCheckInterrupt()) //在这里进行的park interrupted = true; } } finally { if (failed) cancelAcquire(node); } }final boolean acquireQueued(final Node node, int arg) { boolean failed = true; try { boolean interrupted = false; for (;;) { final Node p = node.predecessor(); if (p == head && tryAcquire(arg)) { setHead(node); p.next = null; // help GC failed = false; return interrupted; } if (shouldParkAfterFailedAcquire(p, node) && parkAndCheckInterrupt()) //在这里进行的park interrupted = true; } } finally { if (failed) cancelAcquire(node); } }
愿链接https://www.cnblogs.com/sunankang/p/16458795.htm.
技术交流欢迎加群
标签:node,false,interrupted,failed,acquireQueued,boolean,进入,方法,final 来源: https://www.cnblogs.com/huangjiangyong/p/16458934.html