Code example for AtomicBoolean

Methods: getAndSet

0
        } 
    } 
 
    @CalledByNative 
    private void setTimer() { 
        if (!mTimerFired.getAndSet(false)) {
            // mTimerFired was already false. 
            return; 
        } 
        if (startupComplete()) { 
            sendEmptyMessage(TIMER_MESSAGE);
        } else { 
            sendMessageAtFrontOfQueue(obtainMessage(TIMER_MESSAGE));
        } 
    } 
 
    // If millis <=0, it'll send a TIMER_MESSAGE instead of 
    // a DELAYED_TIMER_MESSAGE. 
    @SuppressWarnings("unused") 
    @CalledByNative 
    private void setDelayedTimer(long millis) {