Code example for AtomicLong

Methods: compareAndSet

0
    { 
        if(isTransactional()) 
        { 
            //There can currently only be at most one outstanding transaction 
            //due to only having LocalTransaction support. Set value to 0 if 1. 
            _txnCount.compareAndSet(1,0);
        } 
    } 
 
    /** 
     * Update last transaction activity timestamp 
     */ 
    public void updateTransactionalActivity() 
    { 
        if (isTransactional()) 
        { 
            _txnUpdateTime.set(System.currentTimeMillis());
        } 
    } 
 
    public Long getTxnStarts()