Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make helpRemove actually lock-free and address multiple chained remov… #2795

Merged
merged 1 commit into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public actual open class LockFreeLinkedListNode {
// Helps with removal of this node
public actual fun helpRemove() {
// Note: this node must be already removed
(next as Removed).ref.correctPrev(null)
(next as Removed).ref.helpRemovePrev()
}

// Helps with removal of nodes that are previous to this
Expand Down
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/jvm/test/AbstractLincheckTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ abstract class AbstractLincheckTest : VerifierState() {
open fun StressOptions.customize(isStressTest: Boolean): StressOptions = this

@Test
open fun modelCheckingTest() = ModelCheckingOptions()
fun modelCheckingTest() = ModelCheckingOptions()
.iterations(if (isStressTest) 100 else 20)
.invocationsPerIteration(if (isStressTest) 10_000 else 1_000)
.commonConfiguration()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@ import kotlinx.coroutines.sync.*
import org.jetbrains.kotlinx.lincheck.*
import org.jetbrains.kotlinx.lincheck.annotations.Operation
import org.jetbrains.kotlinx.lincheck.strategy.managed.modelchecking.*
import org.junit.*

class MutexLincheckTest : AbstractLincheckTest() {
private val mutex = Mutex()

override fun modelCheckingTest() {
// Ignored via empty body as the only way
}

@Operation
fun tryLock() = mutex.tryLock()

Expand Down