Sha256: b76f2531806d94ddcdb3f5124ff7205e3dfc3802e5dc91001a85e0c963993802
Contents?: true
Size: 653 Bytes
Versions: 119
Compression:
Stored size: 653 Bytes
Contents
package j2me.util.concurrent.atomic; public class AtomicLong { private volatile long value; public AtomicLong(long initialValue) { value = initialValue; } public AtomicLong() { } public final long get() { return value; } public final void set(long newValue) { value = newValue; } public final long getAndIncrement() { while (true) { long current = get(); long next = current + 1; set(next); //TODO: getAndIncrement // if (compareAndSet(current, next)) return current; } } }
Version data entries
119 entries across 119 versions & 1 rubygems