Lines Matching defs:threads
70 // Number of helper threads needed for select. We need one thread per
74 // A list of helper threads for select.
75 private final List<SelectThread> threads = new ArrayList<SelectThread>();
147 // Calculate number of helper threads needed for poll. If necessary
148 // threads are created here and start waiting on startLock
151 // Wakeup helper threads, waiting on startLock, so they start polling.
152 // Redundant threads will exit here after wakeup.
164 if (threads.size() > 0)
178 // Helper threads wait on this lock for the next poll.
183 // previous one. Incrementing runsCounter and notifying threads will
186 // Triggers threads, waiting on this lock to start polling.
189 notifyAll(); // wake up threads.
214 // Main thread waits on this lock, until all helper threads are done
219 // Number of helper threads, that did not finish yet.
227 threadsToFinish = threads.size(); // helper threads
233 if (threadsToFinish == threads.size()) { // finished poll() first
238 if (threadsToFinish == 0) // all helper threads finished poll().
243 // for helper threads to finish poll().
245 if (threadsToFinish == threads.size()) {
246 // no helper threads finished yet. Wakeup them up.
291 private SubSelector(int threadIndex) { // helper threads
302 // poll for helper threads
434 // Save this exception and let other threads finish.
445 // helper threads may have changed. Adjust this number.
447 if (threadsCount > threads.size()) {
448 // More threads needed. Start more threads.
449 for (int i = threads.size(); i < threadsCount; i++) {
451 threads.add(newThread);
455 } else if (threadsCount < threads.size()) {
456 // Some threads become redundant. Remove them from the threads List.
457 for (int i = threads.size() - 1 ; i >= threadsCount; i--)
458 threads.remove(i).makeZombie();
496 for (SelectThread t: threads) {
524 // Make all remaining helper threads exit
525 for (SelectThread t: threads)
555 if (totalChannels % MAX_SELECTABLE_FDS == 0) { // more threads needed