Skip to content

Commit

Permalink
Add volatile to methodNameMap and chainMap (#34)
Browse files Browse the repository at this point in the history
Modify MethodUtil#methodNameMap and CtSph#chainMap: add `volatile` to keep in line with others
  • Loading branch information
yizhenqiang authored and sczyh30 committed Aug 5, 2018
1 parent b2a3ef2 commit 8075232
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class CtSph implements Sph {
* Same resource({@link ResourceWrapper#equals(Object)}) will share the same
* {@link ProcessorSlotChain}, no matter in which {@link Context}.
*/
private static Map<ResourceWrapper, ProcessorSlotChain> chainMap
private static volatile Map<ResourceWrapper, ProcessorSlotChain> chainMap
= new HashMap<ResourceWrapper, ProcessorSlotChain>();

private static final Object LOCK = new Object();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/
public final class MethodUtil {

private static Map<Method, String> methodNameMap = new HashMap<Method, String>();
private static volatile Map<Method, String> methodNameMap = new HashMap<Method, String>();

private static final Object LOCK = new Object();

Expand Down

0 comments on commit 8075232

Please sign in to comment.