File tree 1 file changed +19
-1
lines changed
core/kotlinx-coroutines-core/test/linearizability
1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,25 @@ class LockFreeListLinearizabilityTest : TestBase() {
48
48
val options = StressOptions ()
49
49
.iterations(100 )
50
50
.invocationsPerIteration(1000 * stressTestMultiplier)
51
- .threads(4 )
51
+ .threads(3 )
52
52
LinChecker .check(LockFreeListLinearizabilityTest ::class .java, options)
53
53
}
54
+
55
+ private var _curElements : ArrayList <Int >? = null
56
+ private val curElements: ArrayList <Int > get() {
57
+ if (_curElements == null ) {
58
+ _curElements = ArrayList ()
59
+ q.forEach<Node > { _curElements !! .add(it.value) }
60
+ }
61
+ return _curElements !!
62
+ }
63
+
64
+ override fun equals (other : Any? ): Boolean {
65
+ other as LockFreeListLinearizabilityTest
66
+ return curElements == other.curElements
67
+ }
68
+
69
+ override fun hashCode (): Int {
70
+ return curElements.hashCode()
71
+ }
54
72
}
You can’t perform that action at this time.
0 commit comments