Code example for AtomicBoolean

Methods: compareAndSet

         * If we're already writing a snapshot, don't bother enqueueing another 
         * request right now. This will reduce the number of individual 
         * snapshots and in turn the total amount of memory consumed (one big 
         * snapshot is smaller than N subset snapshots). 
        if (pending.compareAndSet(false, true)) {
            snapshotWriter.execute(new Runnable() {
                public void run() { 
                    try { 
                        writeSnapshotFile(processName, packageInfo);
                    } finally { 
     * Writes the zygote's snapshot to internal storage if profiling is enabled. 
Stop searching for code, let great code find you!  Add Codota to your java IDE