org.glowroot.shaded.h2.util.SynchronizedVerifier Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2004-2013 H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package org.glowroot.shaded.h2.util;
import java.util.Collections;
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* A utility class that allows to verify access to a resource is synchronized.
*/
public class SynchronizedVerifier {
private static volatile boolean enabled;
private static final Map, AtomicBoolean> DETECT =
Collections.synchronizedMap(new HashMap, AtomicBoolean>());
private static final Map