bug 10976: NPE fix to avoid blocking shutdown process

This commit is contained in:
Kelven Yang 2011-08-05 14:06:34 -07:00
parent 6eacc11222
commit e4a1d491c1

View File

@ -103,10 +103,12 @@ public class GlobalLock {
private static void releaseInternLock(String name) {
synchronized(s_lockMap) {
GlobalLock lock = s_lockMap.get(name);
assert(lock != null);
if(lock.referenceCount == 0)
s_lockMap.remove(name);
if(lock != null) {
if(lock.referenceCount == 0)
s_lockMap.remove(name);
} else {
s_logger.warn("Releasing " + name + ", but it is already released.");
}
}
}