Code example for AtomicBoolean

Methods: set

0
        return status;
    } 
 
     
    public void cancel() { 
        mCancellationRequested.set(true);   // atomic set; there is no need of synchronizing it
    } 
 
}