code: public synchronized T get(int maxAssigned) throws InterruptedException {
          while (this.queueItems.isEmpty() || this.assignedJobs.size() >= maxAssigned) {
              this.wait(200);
              if (this.isInterrupted) {
                  this.isInterrupted = false;
                  return null;
              }
          }
  
          if (this.scheduleNeeded) {
              this.scheduleNeeded = false;
              schedule(displayModel.getTileSize());
          }
  
          T job = this.queueItems.remove(0).object;
          this.assignedJobs.add(job);
          return job;
      }
docs: Returns the most important entry from this queue. The method blocks while this queue is empty
  or while there are already a certain number of jobs assigned.
  
  @param maxAssigned the maximum number of jobs that should be assigned at any one point. If there
  are already so many jobs assigned, the queue will block. This is to ensure
  that the scheduling will continue to work.