Code example for AtomicInteger

Methods: getAndDecrement

0
  public String getName() {
    return name;
  } 
 
  public RawThread remove() { 
    counter.getAndDecrement();
    return queue.remove(0);
  } 
 
  @Override 
  public boolean remove(Object o) {
    if (queue.remove(o)) {
      counter.getAndDecrement();
      return true; 
    } 
    return false; 
  } 
 
  @Override 
  public boolean add(RawThread thread) {
    counter.incrementAndGet();