Example usage for java.util.concurrent.atomic AtomicLong getAndDecrement

List of usage examples for java.util.concurrent.atomic AtomicLong getAndDecrement

Introduction

In this page you can find the example usage for java.util.concurrent.atomic AtomicLong getAndDecrement.

Prototype

public final long getAndDecrement() 

Source Link

Document

Atomically decrements the current value, with memory effects as specified by VarHandle#getAndAdd .

Usage

From source file:Main.java

public static void main(String[] argv) {
    AtomicLong nextId = new AtomicLong();

    System.out.println(nextId.getAndDecrement());
}