Code example for AtomicBoolean

Methods: compareAndSet

0
        ttsLatch.countDown();
    } 
 
    /** Shuts down the TTS engine. */ 
    public void shutdown() { 
        if (isShutdown.compareAndSet(false, true)) {
            tts.shutdown();
        } 
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java