Examples of compareAndSet()


Examples of java.util.concurrent.atomic.AtomicInteger.compareAndSet()

                            }
                        }
                        @Override
                        public void handleResultComplete() {
                            synchronized(failureResult) {
                                status.compareAndSet(0, 1);
                                if(count.decrementAndGet() == 0) {
                                    handleComplete();
                                }
                            }
                        }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicInteger.compareAndSet()

                        public void handleFailed(ModelNode failureDescription) {
                            synchronized(failureResult) {
                                if(failureDescription != null)  {
                                    failureResult.add(failureDescription);
                                }
                                status.compareAndSet(0, 2);
                                if(count.decrementAndGet() == 0) {
                                    handleComplete();
                                }
                            }
                        }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicInteger.compareAndSet()

                            }
                        }
                        @Override
                        public void handleCancellation() {
                            synchronized(failureResult) {
                                status.compareAndSet(0, 3);
                                if(count.decrementAndGet() == 0) {
                                    handleComplete();
                                }
                            }
                        }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicInteger.compareAndSet()

            }

            @Override
            public void handleResultComplete() {
                synchronized (finalResult) {
                    status.compareAndSet(0, 1);
                    finalResult.notify();
                }
            }

            @Override
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicInteger.compareAndSet()

            }

            @Override
            public void handleFailed(final ModelNode failureDescription) {
                synchronized (finalResult) {
                    if (status.compareAndSet(0, 3)) {
                        if (failureDescription != null && failureDescription.isDefined()) {
                            finalResult.get(FAILURE_DESCRIPTION).set(failureDescription);
                        }
                    }
                    finalResult.notify();
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicInteger.compareAndSet()

            }

            @Override
            public void handleCancellation() {
                synchronized (finalResult) {
                    if (status.compareAndSet(0, 2)) {
                        finalResult.remove(RESULT);
                    }
                    finalResult.notify();
                }
            }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicInteger.compareAndSet()

                }

                @Override
                public void handleResultComplete() {
                    clearAsynchronousOperation(asynchronousRequestId);
                    if(!status.compareAndSet(0, 1)) {
                        throw new RuntimeException("Result already set");
                    }
                    completeLatch.countDown();
                }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicInteger.compareAndSet()

                }

                @Override
                public void handleFailed(final ModelNode failureDescription) {
                    clearAsynchronousOperation(asynchronousRequestId);
                    if(!status.compareAndSet(0, 2)) {
                        throw new RuntimeException("Result already set");
                    }
                    failureHolder.setFailure(failureDescription);
                    completeLatch.countDown();
                }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicInteger.compareAndSet()

                }

                @Override
                public void handleCancellation() {
                    clearAsynchronousOperation(asynchronousRequestId);
                    if(!status.compareAndSet(0, 3)) {
                        throw new RuntimeException("Result already set");
                    }
                    completeLatch.countDown();
                }
            });
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicLong.compareAndSet()

        long oldseed, nextseed;
        AtomicLong seed = this.seed;
        do {
      oldseed = seed.get();
      nextseed = (oldseed * multiplier + addend) & mask;
        } while (!seed.compareAndSet(oldseed, nextseed));
        return (int)(nextseed >>> (48 - bits));
    }

    /**
     * Generates random bytes and places them into a user-supplied
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.