美文网首页
stampedlock

stampedlock

作者: 九州智库 | 来源:发表于2018-02-27 14:38 被阅读6次

A First Level Header

====================

A Second Level Header

---------------------

Now is the time for all good men to come to

the aid of their country. This is just a

regular paragraph.

The quick brown fox jumped over the lazy

dog's back.

### Header 3

> This is a blockquote.

>

> This is the second paragraph in the blockquote.

>

> ## This is an H2 in a blockquote

* for (int spins = -1;;) {

            WNode h, np, pp; int ps;

            if ((h = whead) == p) {

                if (spins < 0)

                    spins = HEAD_SPINS;

                else if (spins < MAX_HEAD_SPINS)

                    spins <<= 1;

                for (int k = spins;;) { // spin at head

                    long s, ns;

                    if (((s = state) & ABITS) == 0L) {

                        if (U.compareAndSwapLong(this, STATE, s,

                                                ns = s + WBIT)) {

                            whead = node;

                            node.prev = null;

                            return ns;

                        }

                    }

                    else if (LockSupport.nextSecondarySeed() >= 0 &&

                            --k <= 0)

                        break;

                }

            }

            else if (h != null) { // help release stale waiters

                WNode c; Thread w;

                while ((c = h.cowait) != null) {

                    if (U.compareAndSwapObject(h, WCOWAIT, c, c.cowait) &&

                        (w = c.thread) != null)

                        U.unpark(w);

                }

            }

相关文章

网友评论

      本文标题:stampedlock

      本文链接:https://www.haomeiwen.com/subject/hkxmxftx.html