Code example for BlockingQueue

Methods: clear, isEmpty

0
				 
				Log.d(TAG, "permits: " + serialBufferAvail.availablePermits());
				int inuse = TINYG_BUFFER_SIZE - serialBufferAvail.availablePermits();
				if (inuse > 0)
					serialBufferAvail.release(inuse);
				if (!queue.isEmpty()) {
					queue.clear();
					flushed = true;
				} 
				paused = false;
				writeLock.release();
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block 
				e.printStackTrace();
			} 
	} 
	 
	public void send_resume() { 
		if (paused) {
			Log.d(TAG, "Sending cycle start");
			write("~");