package com.chenyang.nse.bussiness.service.webApi.business;

import com.chenyang.nse.bussiness.entity.webApi.ApiCode;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;

public class TaskContext {
   public final int type;
   public int number;
   public List<TaskData> datas = new ArrayList();
   public ApiCode status;
   private CountDownLatch latch;

   public void countDown() {
      this.latch.countDown();
   }

   public void countDownAll() {
      long count = this.latch.getCount();

      for(long i = 0L; i < count; ++i) {
         this.latch.countDown();
      }

   }

   public TaskContext(int type, CountDownLatch latch) {
      this.latch = latch;
      this.type = type;
   }

   public CountDownLatch getLatch() {
      return this.latch;
   }
}
