public BasePacket getReturnPacket(int timeout) {
    	if(lock == null)
    		return returnPacket;
    	
    	lock.lock();
		try {
			while (returnPacket == null)
				cond.await(timeout, TimeUnit.MILLISECONDS);
		} catch (Exception e) {

		} finally {
			lock.unlock();
		}
		return returnPacket;
    }