Code example for AtomicBoolean

Methods: set

0
        return status;
    } 
 
     
    public void cancel() { 
        mCancellationRequested.set(true);   // atomic set; there is no need of synchronizing it
    } 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java