Skip to content

Commit

Permalink
Fixed visibility of atomic properties, they are required to be privat…
Browse files Browse the repository at this point in the history
…e or internal (#3808)

The new atomicfu JVM compiler plugin (since 1.9.20) will explicitly require atomic properties to be private or internal (or to be members of private or internal classes).

See: Kotlin/kotlinx-atomicfu#322
YT issue: KT-60528
  • Loading branch information
mvicsokolova authored Jul 18, 2023
1 parent 4cfd88a commit 38909c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class LimitedParallelismConcurrentTest : TestBase() {
@Test
fun testNotDoingDispatchesWhenNoTasksArePresent() = runTest {
class NaggingDispatcher: CoroutineDispatcher() {
val closed = atomic(false)
private val closed = atomic(false)
override fun dispatch(context: CoroutineContext, block: Runnable) {
if (closed.value)
fail("Dispatcher was closed, but still dispatched a task")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import kotlin.coroutines.*
import kotlin.test.*

class MultithreadedDispatcherStressTest {
val shared = atomic(0)
private val shared = atomic(0)

/**
* Tests that [newFixedThreadPoolContext] will not drop tasks when closed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class JobHandlersUpgradeStressTest : TestBase() {
@Volatile
private var job: Job? = null

class State {
internal class State {
val state = atomic(0)
}

Expand Down

0 comments on commit 38909c7

Please sign in to comment.