mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 10976: NPE fix to avoid blocking shutdown process
This commit is contained in:
parent
6eacc11222
commit
e4a1d491c1
@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user