package kotlinx.coroutines.internal import java.util.* import kotlin.concurrent.withLock as withLockJvm internal actual typealias ReentrantLock = java.util.concurrent.locks.ReentrantLock internal actual inline fun ReentrantLock.withLock(action: () -> T) = this.withLockJvm(action) @Suppress("ACTUAL_WITHOUT_EXPECT", "NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS") // Visibility internal actual typealias WorkaroundAtomicReference = java.util.concurrent.atomic.AtomicReference // BenignDataRace is OptionalExpectation and doesn't have to be here // but then IC breaks. See KT-66317 @Retention(AnnotationRetention.SOURCE) @Target(AnnotationTarget.FIELD) internal actual annotation class BenignDataRace() @Suppress("NOTHING_TO_INLINE") // So that R8 can completely remove ConcurrentKt class internal actual inline fun identitySet(expectedSize: Int): MutableSet = Collections.newSetFromMap(IdentityHashMap(expectedSize))