Skip to content

Commit

Permalink
Use CopyOnWriteArrayList for ScalingDeadlockTest
Browse files Browse the repository at this point in the history
  • Loading branch information
sksamuel committed Nov 4, 2023
1 parent 2e0ad33 commit 2ca50e7
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -6,6 +6,7 @@ import com.sksamuel.scrimage.ImmutableImage
import io.kotest.core.spec.style.FunSpec
import io.kotest.inspectors.forAll
import io.kotest.matchers.shouldBe
import java.util.concurrent.CopyOnWriteArrayList
import java.util.concurrent.CountDownLatch
import kotlin.concurrent.thread

Expand All @@ -14,7 +15,7 @@ class ScalingDeadlockTest : FunSpec({
val image = ImmutableImage.loader().fromStream(javaClass.getResourceAsStream("/com/sksamuel/scrimage/bird.jpg"))

test("image scale should not deadlock on multiple concurrent scales") {
val images = mutableListOf<ImmutableImage>()
val images = CopyOnWriteArrayList<ImmutableImage>()
val latch = CountDownLatch(50)
repeat(50) {
thread {
Expand Down

0 comments on commit 2ca50e7

Please sign in to comment.