11.08., 9:00 - 11:00: Due to updates GitLab will be unavailable for some minutes between 09:00 and 11:00.

Commit 5be80e2c authored by Benedikt Zoennchen's avatar Benedikt Zoennchen

use a threadsafe map to enable CachedPointLocator used in a multi-thread environment.

parent 314b32e2
Pipeline #268264 passed with stages
in 134 minutes and 5 seconds
...@@ -8,9 +8,9 @@ import org.vadere.meshing.mesh.inter.ITriConnectivity; ...@@ -8,9 +8,9 @@ import org.vadere.meshing.mesh.inter.ITriConnectivity;
import org.vadere.meshing.mesh.inter.IVertex; import org.vadere.meshing.mesh.inter.IVertex;
import org.vadere.util.geometry.shapes.IPoint; import org.vadere.util.geometry.shapes.IPoint;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
public class CachedPointLocator<V extends IVertex, E extends IHalfEdge, F extends IFace> implements IPointLocator<V, E, F> { public class CachedPointLocator<V extends IVertex, E extends IHalfEdge, F extends IFace> implements IPointLocator<V, E, F> {
...@@ -21,7 +21,7 @@ public class CachedPointLocator<V extends IVertex, E extends IHalfEdge, F extend ...@@ -21,7 +21,7 @@ public class CachedPointLocator<V extends IVertex, E extends IHalfEdge, F extend
public CachedPointLocator(@NotNull final IPointLocator<V, E, F> pointLocator, @NotNull final ITriConnectivity<V, E, F> triConnectivity) { public CachedPointLocator(@NotNull final IPointLocator<V, E, F> pointLocator, @NotNull final ITriConnectivity<V, E, F> triConnectivity) {
this.pointLocator = pointLocator; this.pointLocator = pointLocator;
this.triConnectivity = triConnectivity; this.triConnectivity = triConnectivity;
this.cache = new HashMap<>(); this.cache = new ConcurrentHashMap<>();
} }
@Override @Override
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment