Package java.util.concurrent.atomic

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


                ReusableBuffer plb = ReusableBuffer.wrap(pl.getBytes());
                l.append(new LogEntry(plb, sl, LogEntry.PAYLOAD_TYPE_INSERT));
            }
            synchronized (count) {
                if (count.get() < 100)
                    count.wait();
            }
           
            try {
                l.lock();
                // LSN lsn =
View Full Code Here


                l.append(e);
            }
           
            synchronized (count) {
                while (count.get() < numEntries)
                    count.wait(5);
            }
           
            LSN newLSN = null;
            try {
                l.lock();
View Full Code Here

            });
        }
        synchronized (expected) {
            try {
                while (expected.get() > 0) {
                    expected.wait(100);
                }
            } catch (InterruptedException ie) {
            }
        }
    }
View Full Code Here

                                        {
                                            throw new TimeoutException();
                                        }
                                        while ( available.get() == 0 )
                                        {
                                            available.wait(10000);
                                        }

                                        thisQty = (available.get() > 1) ? (random.nextInt(available.get()) + 1) : 1;

                                        available.addAndGet(-1 * thisQty);
 
View Full Code Here

            getConnection().start();
            LOG.info("Starting to asynchronously receive " + client.getRecvCount() + " messages...");
            try {
                while (recvCount.get() < count) {
                    synchronized (recvCount) {
                        recvCount.wait();
                    }
                }
            } catch (InterruptedException e) {
                throw new JMSException("JMS consumer thread wait has been interrupted. Message: " + e.getMessage());
            }
View Full Code Here

            long start = System.currentTimeMillis();
            while (count.get() < number) {
                if (waitTime <= 0) {
                    break;
                } else {
                    count.wait(waitTime);
                    waitTime = maxWaitTime - (System.currentTimeMillis() - start);
                }
            }
        }
        assertTrue("Unexpected count: " + count, count.get() == number);
View Full Code Here

                                                {
                                                    throw new TimeoutException();
                                                }
                                                while ( available.get() == 0 )
                                                {
                                                    available.wait(timing.forWaiting().milliseconds());
                                                }

                                                thisQty = (available.get() > 1) ? (random.nextInt(available.get()) + 1) : 1;

                                                available.addAndGet(-1 * thisQty);
 
View Full Code Here

        };
        final AtomicInteger ctx = new AtomicInteger(3);
        ZKUtil.deleteRecursive(zk, "/a", cb, ctx);
        synchronized (ctx) {
            ctx.wait();
        }
        Assert.assertEquals(4, ((AtomicInteger) ctx).get());
    }
   
    @Test
View Full Code Here

            });
        }
        synchronized (expected) {
            try {
                while (expected.get() > 0) {
                    expected.wait(100);
                }
            } catch (InterruptedException ie) {
            }
        }
    }
View Full Code Here

            }, new LedgerMetadata(1, 1));
        }
        synchronized (expected) {
            try {
                while (expected.get() > 0) {
                    expected.wait(100);
                }
            } catch (InterruptedException ie) {
            }
        }
    }
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.