diff options
author | Sven Gothel <[email protected]> | 2023-08-27 12:56:39 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-08-27 13:09:33 +0200 |
commit | c13fed83f20db55ee0b0b548ef6526a95fd2d6c4 (patch) | |
tree | 4077cdda18843082245399544384ee8bf3981caa /src/graphui/classes/com/jogamp/graph/ui/Scene.java | |
parent | faa80aa8c6e5231ed4c00df6ccb0fb715974eb40 (diff) |
GraphUI: Use thread-save and lock-free CopyOnWriteArrayList for List<Shape>, allowing off-thread mutation
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph/ui/Scene.java')
-rw-r--r-- | src/graphui/classes/com/jogamp/graph/ui/Scene.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/Scene.java b/src/graphui/classes/com/jogamp/graph/ui/Scene.java index 5100aabf7..6abbc7f08 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Scene.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Scene.java @@ -29,12 +29,12 @@ package com.jogamp.graph.ui; import java.io.File; import java.nio.ByteBuffer; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Comparator; import java.util.List; import java.util.Locale; +import java.util.concurrent.CopyOnWriteArrayList; import com.jogamp.opengl.FPSCounter; import com.jogamp.opengl.GL; @@ -109,7 +109,7 @@ public final class Scene implements Container, GLEventListener { @SuppressWarnings("unused") private static final boolean DEBUG = false; - private final List<Shape> shapes = new ArrayList<Shape>(); + private final List<Shape> shapes = new CopyOnWriteArrayList<Shape>(); private float dbgBorderThickness = 0f; private boolean doFrustumCulling = false; |