All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.internal.Concurrent.common.kt Maven / Gradle / Ivy

There is a newer version: 1.9.0
Show newest version
/*
 * Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 */

package kotlinx.coroutines.internal

internal expect class ReentrantLock() {
    fun tryLock(): Boolean
    fun unlock()
}

internal expect inline fun  ReentrantLock.withLock(action: () -> T): T

internal expect fun  identitySet(expectedSize: Int): MutableSet

/**
 * Annotation indicating that the marked property is the subject of benign data race.
 * LLVM does not support this notion, so on K/N platforms we alias it into `@Volatile` to prevent potential OoTA.
 *
 * The purpose of this annotation is not to save an extra-volatile on JVM platform, but rather to explicitly emphasize
 * that data-race is benign.
 */
@OptionalExpectation
@Target(AnnotationTarget.FIELD)
@OptIn(ExperimentalMultiplatform::class)
internal expect annotation class BenignDataRace()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy