提交 9f3a2b5b 编写于 作者: O Oliver Gondža

Merge pull request #1262 from synopsys-arc-oss/javadoc_hudson_model_executor_isActive

Javadoc: Noting changes in Executor availability check approaches (1.536)
......@@ -63,7 +63,9 @@ import javax.annotation.CheckForNull;
/**
* Thread that executes builds.
*
* Since 1.536, {@link Executor}s start threads on-demand.
* The entire logic should use {@link #isActive()} instead of {@link #isAlive()}
* in order to check if the {@link Executor} it ready to take tasks.
* @author Kohsuke Kawaguchi
*/
@ExportedBean
......@@ -345,6 +347,15 @@ public class Executor extends Thread implements ModelObject {
return executable!=null;
}
/**
* Check if executor is ready to accept tasks.
* This method becomes the critical one since 1.536, which introduces the
* on-demand creation of executor threads. The entire logic should use
* this method instead of {@link #isAlive()}, because it provides wrong
* information for non-started threads.
* @return True if the executor is available for tasks
* @since 1.536
*/
public boolean isActive() {
return !started || isAlive();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册