地质所 沉降监测网建设项目
suerwei
2024-06-18 4ed2dd8ef299ce534505456813f15ee5c5c95616
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.javaweb.common.utils.thread.parallel;
 
 
 
import com.javaweb.common.utils.thread.exception.ChildThreadException;
 
import java.util.concurrent.CountDownLatch;
 
 
/**
 * 并行任务参数
 * @author zengyuanjun
 *
 */
public class MultiParallelContext {
    /**
     * 运行的任务
     */
    private Runnable task;
    /**
     * 子线程倒计数锁
     */
    private CountDownLatch childLatch;
    /**
     * 子线程异常
     */
    private ChildThreadException childException;
    
    public MultiParallelContext() {
    }
    
    public MultiParallelContext(Runnable task, CountDownLatch childLatch, ChildThreadException childException) {
        this.task = task;
        this.childLatch = childLatch;
        this.childException = childException;
    }
 
 
    public Runnable getTask() {
        return task;
    }
    public void setTask(Runnable task) {
        this.task = task;
    }
    public CountDownLatch getChildLatch() {
        return childLatch;
    }
    public void setChildLatch(CountDownLatch childLatch) {
        this.childLatch = childLatch;
    }
    public ChildThreadException getChildException() {
        return childException;
    }
    public void setChildException(ChildThreadException childException) {
        this.childException = childException;
    }
    
}