70 // Number of helper threads needed for select. We need one thread per |
70 // Number of helper threads needed for select. We need one thread per |
71 // each additional set of MAX_SELECTABLE_FDS - 1 channels. |
71 // each additional set of MAX_SELECTABLE_FDS - 1 channels. |
72 private int threadsCount = 0; |
72 private int threadsCount = 0; |
73 |
73 |
74 // A list of helper threads for select. |
74 // A list of helper threads for select. |
75 private final List threads = new ArrayList(); |
75 private final List<Thread> threads = new ArrayList<Thread>(); |
76 |
76 |
77 //Pipe used as a wakeup object. |
77 //Pipe used as a wakeup object. |
78 private final Pipe wakeupPipe; |
78 private final Pipe wakeupPipe; |
79 |
79 |
80 // File descriptors corresponding to source and sink |
80 // File descriptors corresponding to source and sink |
81 private final int wakeupSourceFd, wakeupSinkFd; |
81 private final int wakeupSourceFd, wakeupSinkFd; |
82 |
82 |
83 // Maps file descriptors to their indices in pollArray |
83 // Maps file descriptors to their indices in pollArray |
84 private final static class FdMap extends HashMap<Integer, MapEntry> { |
84 private final static class FdMap extends HashMap<Integer, MapEntry> { |
|
85 static final long serialVersionUID = 0L; |
85 private MapEntry get(int desc) { |
86 private MapEntry get(int desc) { |
86 return get(new Integer(desc)); |
87 return get(new Integer(desc)); |
87 } |
88 } |
88 private MapEntry put(SelectionKeyImpl ski) { |
89 private MapEntry put(SelectionKeyImpl ski) { |
89 return put(new Integer(ski.channel.getFDVal()), new MapEntry(ski)); |
90 return put(new Integer(ski.channel.getFDVal()), new MapEntry(ski)); |