Modifier and Type | Field and Description |
---|---|
protected TDBarrier |
barrier |
protected IThreadPool |
pool |
static int |
SERIAL |
Constructor and Description |
---|
PJob() |
PJob(IThreadPool pool) |
Modifier and Type | Method and Description |
---|---|
void |
add(PTask task)
Use this method to add tasks to this job.
|
void |
add(PTask task,
int threadID)
Use this method to add tasks to this job.
|
void |
execute()
Executor method of a job.
|
void |
execute(boolean block)
Executor method of a job.
|
void |
finishTask()
Call back function for thread pool workers, to tell this job that a task
of this job is finished.
|
IThreadPool |
getThreadPool() |
void |
join()
Wait for the job while not finishing.
|
public static final int SERIAL
protected IThreadPool pool
protected TDBarrier barrier
public PJob()
public PJob(IThreadPool pool)
public void finishTask()
public void execute()
public void execute(boolean block)
public void join()
public void add(PTask task, int threadID)
task
- public void add(PTask task)
task
- public IThreadPool getThreadPool()