Skip to content

Commit af3c0c4

Browse files
committed
use ConcurrentHashMap for thread safety
1 parent 6e93f0c commit af3c0c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

portalProxy/src/main/kotlin/Portal.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package de.binarynoise.captiveportalautologin.portalproxy.portal
22

3+
import java.util.concurrent.ConcurrentHashMap
34
import kotlinx.coroutines.CoroutineScope
45
import kotlinx.html.*
56
import kotlinx.html.stream.*
@@ -12,7 +13,7 @@ import io.vertx.kotlin.coroutines.coroutineRouter
1213
const val portalHost = "binarynoise.de"
1314
const val portalPort = 8000
1415

15-
private val database = HashMap<String, Boolean>()
16+
private val database = ConcurrentHashMap<String, Boolean>()
1617

1718
fun CoroutineScope.portalRouter(vertx: Vertx): Router {
1819
val router = Router.router(vertx)

0 commit comments

Comments
 (0)