Examples of unpark()


Examples of co.paralleluniverse.strands.Strand.unpark()

            }
            if (q != null) {
                for (WNode r = q;;) {  // release co-waiters too
                    if ((w = r.strand) != null) {
                        r.strand = null;
                        w.unpark();
                    }
                    if ((r = q.cowait) == null)
                        break;
                    U.compareAndSwapObject(q, WCOWAIT, r, r.cowait);
                }
View Full Code Here

Examples of co.paralleluniverse.strands.Strand.unpark()

                        : (m < WBIT && (ns = tryIncReaderOverflow(s)) != 0L)) {
                    if (group != null) {  // help release others
                        for (WNode r = group;;) {
                            if ((w = r.strand) != null) {
                                r.strand = null;
                                w.unpark();
                            }
                            if ((r = group.cowait) == null)
                                break;
                            U.compareAndSwapObject(group, WCOWAIT, r, r.cowait);
                        }
View Full Code Here

Examples of co.paralleluniverse.strands.Strand.unpark()

                            while ((r = node.cowait) != null) {
                                if (U.compareAndSwapObject(node, WCOWAIT,
                                        r, r.cowait)
                                        && (w = r.strand) != null) {
                                    r.strand = null;
                                    w.unpark(); // release co-waiter
                                }
                            }
                            return ns;
                        }
                    } else if (ThreadLocalRandom.current().nextInt() >= 0
View Full Code Here

Examples of co.paralleluniverse.strands.Strand.unpark()

                WNode r; // detach and wake up uncancelled co-waiters
                while ((r = node.cowait) != null) {
                    if (U.compareAndSwapObject(node, WCOWAIT, r, r.cowait)
                            && (w = r.strand) != null) {
                        r.strand = null;
                        w.unpark();
                    }
                }
                for (WNode pred = node.prev; pred != null;) { // unsplice
                    WNode succ, pp;        // find valid successor
                    while ((succ = node.next) == null
View Full Code Here

Examples of co.paralleluniverse.strands.Strand.unpark()

                    }
                    if (pred.next == node) // unsplice pred link
                        U.compareAndSwapObject(pred, WNEXT, node, succ);
                    if (succ != null && (w = succ.strand) != null) {
                        succ.strand = null;
                        w.unpark();       // wake up succ to observe new pred
                    }
                    if (pred.status != CANCELLED || (pp = pred.prev) == null)
                        break;
                    node.prev = pp;        // repeat if new pred wrong/cancelled
                    U.compareAndSwapObject(pp, WNEXT, pred, succ);
View Full Code Here

Examples of co.paralleluniverse.strands.Strand.unpark()

            }
            if (q != null) {
                for (WNode r = q;;) {  // release co-waiters too
                    if ((w = r.strand) != null) {
                        r.strand = null;
                        w.unpark();
                    }
                    if ((r = q.cowait) == null)
                        break;
                    U.compareAndSwapObject(q, WCOWAIT, r, r.cowait);
                }
View Full Code Here

Examples of co.paralleluniverse.strands.Strand.unpark()

                        : (m < WBIT && (ns = tryIncReaderOverflow(s)) != 0L)) {
                    if (group != null) {  // help release others
                        for (WNode r = group;;) {
                            if ((w = r.strand) != null) {
                                r.strand = null;
                                w.unpark();
                            }
                            if ((r = group.cowait) == null)
                                break;
                            U.compareAndSwapObject(group, WCOWAIT, r, r.cowait);
                        }
View Full Code Here

Examples of co.paralleluniverse.strands.Strand.unpark()

                            while ((r = node.cowait) != null) {
                                if (U.compareAndSwapObject(node, WCOWAIT,
                                        r, r.cowait)
                                        && (w = r.strand) != null) {
                                    r.strand = null;
                                    w.unpark(); // release co-waiter
                                }
                            }
                            return ns;
                        }
                    } else if (ThreadLocalRandom.current().nextInt() >= 0
View Full Code Here

Examples of co.paralleluniverse.strands.Strand.unpark()

                WNode r; // detach and wake up uncancelled co-waiters
                while ((r = node.cowait) != null) {
                    if (U.compareAndSwapObject(node, WCOWAIT, r, r.cowait)
                            && (w = r.strand) != null) {
                        r.strand = null;
                        w.unpark();
                    }
                }
                for (WNode pred = node.prev; pred != null;) { // unsplice
                    WNode succ, pp;        // find valid successor
                    while ((succ = node.next) == null
View Full Code Here

Examples of co.paralleluniverse.strands.Strand.unpark()

                    }
                    if (pred.next == node) // unsplice pred link
                        U.compareAndSwapObject(pred, WNEXT, node, succ);
                    if (succ != null && (w = succ.strand) != null) {
                        succ.strand = null;
                        w.unpark();       // wake up succ to observe new pred
                    }
                    if (pred.status != CANCELLED || (pp = pred.prev) == null)
                        break;
                    node.prev = pp;        // repeat if new pred wrong/cancelled
                    U.compareAndSwapObject(pp, WNEXT, pred, succ);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.