Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,16 @@ private[nio] class ConnectionManager(
// to be able to track asynchronous messages
private val idCount: AtomicInteger = new AtomicInteger(1)

private val writeRunnableStarted: HashSet[SelectionKey] = new HashSet[SelectionKey]()
private val readRunnableStarted: HashSet[SelectionKey] = new HashSet[SelectionKey]()

private val selectorThread = new Thread("connection-manager-thread") {
override def run() = ConnectionManager.this.run()
}
selectorThread.setDaemon(true)
// start this thread last, since it invokes run(), which accesses members above
selectorThread.start()

private val writeRunnableStarted: HashSet[SelectionKey] = new HashSet[SelectionKey]()

private def triggerWrite(key: SelectionKey) {
val conn = connectionsByKey.getOrElse(key, null)
if (conn == null) return
Expand Down Expand Up @@ -232,7 +234,6 @@ private[nio] class ConnectionManager(
} )
}

private val readRunnableStarted: HashSet[SelectionKey] = new HashSet[SelectionKey]()

private def triggerRead(key: SelectionKey) {
val conn = connectionsByKey.getOrElse(key, null)
Expand Down