From 5a02996de5814b2cd3b9f4d7e353ea353f0bc99e Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Mon, 21 Nov 2022 14:43:28 +0100 Subject: [PATCH] ~fix off-by-one --- .../jvm/src/debug/internal/DebugProbesImpl.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kotlinx-coroutines-core/jvm/src/debug/internal/DebugProbesImpl.kt b/kotlinx-coroutines-core/jvm/src/debug/internal/DebugProbesImpl.kt index 3357c43278..bc6ff0962c 100644 --- a/kotlinx-coroutines-core/jvm/src/debug/internal/DebugProbesImpl.kt +++ b/kotlinx-coroutines-core/jvm/src/debug/internal/DebugProbesImpl.kt @@ -69,7 +69,7 @@ internal object DebugProbesImpl { private val callerInfoCache = ConcurrentWeakMap(weakRefQueue = true) fun install() { - if (installations.incrementAndGet() > 1) return + if (installations.getAndIncrement() > 1) return startWeakRefCleanerThread() if (AgentInstallationType.isInstalledStatically) return dynamicAttach?.invoke(true) // attach