Package java.util.concurrent.atomic

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


            @Override
            public void failed(BabuDBException error, Object context) {
               
                if (notReady.decrementAndGet() == 0) {
                    synchronized (notReady) {
                        notReady.notify();
                    }
                }
                fail("This should not happen.");
            }
        });
View Full Code Here


                       
                        // notify, if the last chunk was inserted
                        synchronized (openChunks) {
                            if (openChunks.get() != -1 && openChunks.
                                    decrementAndGet() == 0)
                                openChunks.notify();
                        }
                    }

                    @Override
                    public void requestFailed(Exception e) {
View Full Code Here

                                fileName, pos1, e.getMessage());
                        }
                       
                        synchronized (openChunks) {
                            openChunks.set(-1);
                            openChunks.notify();
                        }
                    }
                });
            }       
        }
View Full Code Here

                       
                        @Override
                        public void finished(Object result, Object context) {
                            synchronized (count) {
                                if (count.decrementAndGet() == 0)
                                    count.notify();
                            }
                        }
                       
                        @Override
                        public void failed(BabuDBException error, Object context) {
View Full Code Here

                        @Override
                        public void failed(BabuDBException error, Object context) {
                            Logging.logError(Logging.LEVEL_ERROR, stage, error);
                            synchronized (count) {
                                count.set(-1);
                                count.notify();
                            }
                        }
                    });
                } finally {
                    this.checksum.reset();
View Full Code Here

                        createdLedgers.add(ledgerId);
                    }
                    synchronized (expected) {
                        int num = expected.decrementAndGet();
                        if (num == 0) {
                            expected.notify();
                        }
                    }
                }
            });
        }
View Full Code Here

        getJmsConsumer().setMessageListener(new MessageListener() {
            public void onMessage(Message msg) {
                incThroughput();
                recvCount.incrementAndGet();
                synchronized (recvCount) {
                    recvCount.notify();
                }
               
                try {
                  commitTxIfNecessary();
                } catch (JMSException ex) {
View Full Code Here

                        session.createReceiver(queue);
                        connection.start();

                        if (count.incrementAndGet() >= number) {
                            synchronized (count) {
                                count.notify();
                            }
                        }
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
View Full Code Here

                        createdLedgers.add(ledgerId);
                    }
                    synchronized (expected) {
                        int num = expected.decrementAndGet();
                        if (num == 0) {
                            expected.notify();
                        }
                    }
                }
            });
        }
View Full Code Here

                        }
                    }
                    synchronized (expected) {
                        int num = expected.decrementAndGet();
                        if (num == 0) {
                            expected.notify();
                        }
                    }
                }
            }, new LedgerMetadata(1, 1));
        }
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.