Code example for ConcurrentLinkedQueue

Methods: poll, sleep

0
		playNext(); 
	} 
 
	private void playNext() 
	{ 
		Message m = messages.poll();
		if (m == null)
		{ 
			try 
			{ 
				Thread.sleep(1000);
			} catch (InterruptedException e)
			{ 
				Log.e(TAG, "SpeechService:onUtteranceCompleted " + e);
				e.printStackTrace();
			} 
			m = messages.poll();
		} 
 
		if (m != null)
		{ 
			m.play(mTts);