Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5663a10 authored by Charles Chen's avatar Charles Chen Committed by Android (Google) Code Review
Browse files

Merge "Setting the synth busy flag inside a synchronized block for thread safety."

parents 1ceb79e9 9b7cb792
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -824,11 +824,15 @@ public class TtsService extends Service implements OnCompletionListener {
                try {
                    synthAvailable = synthesizerLock.tryLock();
                    if (!synthAvailable) {
                        synchronized (this) {
                            mSynthBusy = true;
                        }
                        Thread.sleep(100);
                        Thread synth = (new Thread(new SynthThread()));
                        synth.start();
                        synchronized (this) {
                            mSynthBusy = false;
                        }
                        return;
                    }
                    String language = "";