code: public void add(Task task) {
      	synchronized(LOCK) {
      		//terminated task will be selected immediately before start
      		task.setListener(this);
          
      		this.task[wi] = task;        
          
      		wi++;
      	}
      }
docs: Adds task to the chain.
  
  @param task
  @param offset