View | Details | Raw Unified | Return to bug 43642
Collapse All | Expand All

(-)java/org/apache/catalina/core/StandardThreadExecutor.java (+13 lines)
Lines 49-54 Link Here
49
    protected String name;
49
    protected String name;
50
    protected boolean prestartminSpareThreads = false;
51
50
    private LifecycleSupport lifecycle = new LifecycleSupport(this);
52
    private LifecycleSupport lifecycle = new LifecycleSupport(this);
51
    // ---------------------------------------------- Constructors
53
    // ---------------------------------------------- Constructors
52
    public StandardThreadExecutor() {
54
    public StandardThreadExecutor() {
Lines 64-69 Link Here
64
        TaskThreadFactory tf = new TaskThreadFactory(namePrefix);
66
        TaskThreadFactory tf = new TaskThreadFactory(namePrefix);
65
        lifecycle.fireLifecycleEvent(START_EVENT, null);
67
        lifecycle.fireLifecycleEvent(START_EVENT, null);
66
        executor = new ThreadPoolExecutor(getMinSpareThreads(), getMaxThreads(), maxIdleTime, TimeUnit.MILLISECONDS,taskqueue, tf);
68
        executor = new ThreadPoolExecutor(getMinSpareThreads(), getMaxThreads(), maxIdleTime, TimeUnit.MILLISECONDS,taskqueue, tf);
69
        if (prestartminSpareThreads) {
70
            executor.prestartAllCoreThreads();
71
        }
67
        taskqueue.setParent( (ThreadPoolExecutor) executor);
72
        taskqueue.setParent( (ThreadPoolExecutor) executor);
68
        lifecycle.fireLifecycleEvent(AFTER_START_EVENT, null);
73
        lifecycle.fireLifecycleEvent(AFTER_START_EVENT, null);
69
    }
74
    }
Lines 116-121 Link Here
116
        return name;
121
        return name;
117
    }
122
    }
123
    public boolean isPrestartminSpareThreads() {
124
125
        return prestartminSpareThreads;
126
    }
118
    public void setThreadPriority(int threadPriority) {
127
    public void setThreadPriority(int threadPriority) {
119
        this.threadPriority = threadPriority;
128
        this.threadPriority = threadPriority;
120
    }
129
    }
Lines 152-157 Link Here
152
    public void setName(String name) {
161
    public void setName(String name) {
153
        this.name = name;
162
        this.name = name;
154
    }
163
    }
164
165
    public void setPrestartminSpareThreads(boolean prestartminSpareThreads) {
166
        this.prestartminSpareThreads = prestartminSpareThreads;
167
    }
155
    /**
168
    /**
156
     * Add a LifecycleEvent listener to this component.
169
     * Add a LifecycleEvent listener to this component.

Return to bug 43642