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

Version Path
rhodes-2.2.5.beta.1 platform/bb/RubyVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.2.4.beta.1 platform/bb/RubyVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.2.3 platform/bb/RubyVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.2.3.beta.1 platform/bb/RubyVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.2.2 platform/bb/RubyVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.2.2.beta.1 platform/bb/RubyVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.2.1 platform/bb/RubyVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.2.1.beta.2 platform/bb/RubyVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.2.1.beta.1 platform/bb/RubyVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.2.0 platform/bb/RubyVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.2.0.beta.3 platform/bb/RubyVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.2.0.beta.2 platform/bb/RubyVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.2.0.beta.1 platform/bb/RubyVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.1.0 platform/bb/RubyVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.0.3 platform/shared/rubyJVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.0.2 platform/shared/rubyJVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.0.0 platform/shared/rubyJVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.0.0.rc2 platform/shared/rubyJVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.0.0.rc1 platform/shared/rubyJVM/src/j2me/util/concurrent/atomic/AtomicLong.java
rhodes-2.0.0.beta11 platform/shared/rubyJVM/src/j2me/util/concurrent/atomic/AtomicLong.java