Package java.util.concurrent.atomic

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


                        wrapper.releaseLock();

                        // this signals that we're done.
                        synchronized(numExecutingOutputs)
                        {
                           numExecutingOutputs.decrementAndGet();
                           numExecutingOutputs.notifyAll();
                        }
                        if (taskSepaphore != null) taskSepaphore.release();
                     }
                  }
View Full Code Here


                if (eprs != null)
                {
                    final AtomicLong count = eprs.get(epr) ;
                    if (count != null)
                    {
                        if (count.decrementAndGet() == 0)
                        {
                            eprs.remove(epr) ;
                        }
                    }
                }
View Full Code Here

            {
                final ConcurrentMap<EPR, AtomicLong> eprs = serviceInfo.getEPRs() ;
                final AtomicLong count = eprs.get(epr) ;
                if (count != null)
                {
                    if (count.decrementAndGet() == 0)
                    {
                        eprs.remove(epr) ;
                        if (eprs.isEmpty())
                        {
                            removeServiceInfo(service, serviceInfo) ;
View Full Code Here

                        try {
                            fIndexInput.close();
                        } catch (IOException e) {
                            // ignore
                        }
                        if (counter.decrementAndGet() == 0) {
                            latch.countDown();
                        }
                    }

                    @Override public void onFailure(Throwable t) {
View Full Code Here

                            fIndexInput.close();
                        } catch (IOException e) {
                            // ignore
                        }
                        failures.add(t);
                        if (counter.decrementAndGet() == 0) {
                            latch.countDown();
                        }
                    }
                });
            } catch (Exception e) {
View Full Code Here

        Random rand = new Random(random.nextInt());

        @Override
        public void run() {
          try {
            while (operations.decrementAndGet() >= 0) {
              // bias toward a recently changed doc
              int id = rand.nextInt(100) < 25 ? lastId : rand.nextInt(ndocs);

              // when indexing, we update the index, then the model
              // so when querying, we should first check the model, and then the index
View Full Code Here

        Random rand = new Random(random().nextInt());

        @Override
        public void run() {
          try {
            while (operations.decrementAndGet() >= 0) {
              // bias toward a recently changed doc
              int id = rand.nextInt(100) < 25 ? lastId : rand.nextInt(ndocs);

              // when indexing, we update the index, then the model
              // so when querying, we should first check the model, and then the index
View Full Code Here

        for (int i = 0; i < iterationsPerThread; i++) {
          if (flip) {
            if (increment) {
              result.incrementAndGet();
            } else {
              result.decrementAndGet();
            }
            flip = false;
          } else {
            if (increment) {
              result.getAndIncrement();
View Full Code Here

        counter.incrementAndGet();
    }

    private static void decreaseParameter(String parameter) {
        AtomicLong counter = sessionData.get(parameter);
        counter.decrementAndGet();
    }

}
View Full Code Here

            @Override
            public void onNext(T t) {
                if (requested.get() > 0) {
                    child.onNext(t);
                    requested.decrementAndGet();
                }
            }

        };
    }
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.