Skip to content

Commit

Permalink
* Implement equals and hashCode functions for the verification pr…
Browse files Browse the repository at this point in the history
…ocess;

* Use 3 parallel threads, 4 threads with 5 operations in each one is too much.
  • Loading branch information
ndkoval authored and qwwdfsad committed Dec 12, 2018
1 parent 19a2a30 commit e08fd07
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,25 @@ class LockFreeListLinearizabilityTest : TestBase() {
val options = StressOptions()
.iterations(100)
.invocationsPerIteration(1000 * stressTestMultiplier)
.threads(4)
.threads(3)
LinChecker.check(LockFreeListLinearizabilityTest::class.java, options)
}

private var _curElements: ArrayList<Int>? = null
private val curElements: ArrayList<Int> get() {
if (_curElements == null) {
_curElements = ArrayList()
q.forEach<Node> { _curElements!!.add(it.value) }
}
return _curElements!!
}

override fun equals(other: Any?): Boolean {
other as LockFreeListLinearizabilityTest
return curElements == other.curElements
}

override fun hashCode(): Int {
return curElements.hashCode()
}
}

0 comments on commit e08fd07

Please sign in to comment.