Fix race in init
This commit is contained in:
@@ -99,7 +99,7 @@ abstract class IpMonitor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
init {
|
protected fun init() {
|
||||||
thread(name = "${javaClass.simpleName}-input") {
|
thread(name = "${javaClass.simpleName}-input") {
|
||||||
val mode = currentMode
|
val mode = currentMode
|
||||||
if (mode.isMonitor) {
|
if (mode.isMonitor) {
|
||||||
|
|||||||
@@ -57,6 +57,10 @@ class IpNeighbourMonitor private constructor() : IpMonitor() {
|
|||||||
}
|
}
|
||||||
private var neighbours = persistentMapOf<IpDev, IpNeighbour>()
|
private var neighbours = persistentMapOf<IpDev, IpNeighbour>()
|
||||||
|
|
||||||
|
init {
|
||||||
|
init()
|
||||||
|
}
|
||||||
|
|
||||||
override val monitoredObject: String get() = "neigh"
|
override val monitoredObject: String get() = "neigh"
|
||||||
|
|
||||||
override fun processLine(line: String) {
|
override fun processLine(line: String) {
|
||||||
|
|||||||
Reference in New Issue
Block a user