Waits until all jobs of the given family are finished. This method will block the calling thread until all such jobs have finished executing, or until this thread is interrupted. If there are no jobs in the family that are currently waiting, running, or sleeping, this method returns immediately. Feedback on how the join is progressing is provided to a progress monitor.
If this method is called while the job manager is suspended, only jobs that are currently running will be joined; Once there are no jobs in the family in the {@link Job#RUNNING} state, this method returns.
Note that there is a deadlock risk when using join. If the calling thread owns a lock or object monitor that the joined thread is waiting for, deadlock will occur. This method can also result in starvation of the current thread if another thread continues to add jobs of the given family, or if a job in the given family reschedules itself in an infinite loop.
@param family the job family to join, or
null
to join all jobs.
@param monitor Progress monitor for reporting progress on how thewait is progressing, or
null
if no progress monitoring is required.
@exception InterruptedException if this thread is interrupted while waiting
@exception OperationCanceledException if the progress monitor is canceled while waiting
@see Job#belongsTo(Object)
@see #suspend()