Code example for LinkedBlockingQueue

Methods: drainTo, size

0
		} 
		return m_handler;
	} 
	 
	public int getLogMsgs( Collection<LogMsg> c ) {
		int size = m_logQue.size();
		if ( size > 0 ) {
			m_logQue.drainTo(c);
		} 
		return size;
	} 
 
 
	public void addLogMsg( String s, LogMsg.TYPE t, LogMsg.CAT c ) {
		try { 
			while ( m_logQue.size() >= MAX_LOG_MSGS ) {
				m_logQue.take();
			} 
			m_logQue.put(new LogMsg(s, t, c));
		} catch ( Exception e ) {
			Log.d("PP30Lite", "Adding message to Log failed");