Code example for Queue

Methods: add

0
	private final static Lock readLock = readWriteLock.readLock();
	private final static Lock writeLock = readWriteLock.writeLock();
	public static void addUploadFile(String _task) {
		writeLock.lock();
		try { 
			mUploadFileQueue.add(_task);
		} finally { 
			writeLock.unlock();
		} 
	} 
	public static String removeUploadFile() {
		writeLock.lock();
		try { 
			if (!mUploadFileQueue.isEmpty()) {
				return mUploadFileQueue.remove();
			} else { 
				return null; 
			} 
		} finally { 
			writeLock.unlock();
		}