code: public static BlockingQueue<Runnable> buildQueue(int size, boolean isPriority) {
          BlockingQueue<Runnable> queue;
          if (size == 0) { // 默认无队列
              queue = new SynchronousQueue<Runnable>();
          } else { // 有限队列或无限队列
              if (isPriority) {
                  queue = size < 0 ? new PriorityBlockingQueue<Runnable>()
                      : new PriorityBlockingQueue<Runnable>(size);
              } else {
                  queue = size < 0 ? new LinkedBlockingQueue<Runnable>()
                      : new LinkedBlockingQueue<Runnable>(size);
              }
          }
          return queue;
      }
docs: 构建队列
  
  @param size       队列大小
  @param isPriority 是否优先级队列
  @return 队列