Skip to content

Commit

Permalink
nfs: remove double locking
Browse files Browse the repository at this point in the history
do not use synchronized block and lock at the same time.

Acked-by: Albert Rossi
Target: master
Require-book: no
Require-notes: no
  • Loading branch information
kofemann committed Jun 17, 2014
1 parent 6a6fcfd commit b2575fa
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -62,7 +62,7 @@ Collection<deviceid4> getDeviceIds() {
}
}

synchronized PoolDS getByPoolName(String name) {
PoolDS getByPoolName(String name) {
_rlock.lock();
try {
return _poolNameToIpMap.get(name);
Expand All @@ -71,7 +71,7 @@ synchronized PoolDS getByPoolName(String name) {
}
}

synchronized PoolDS getByDeviceId(deviceid4 deviceId) {
PoolDS getByDeviceId(deviceid4 deviceId) {
_rlock.lock();
try {
return _deviceMap.get(deviceId);
Expand All @@ -80,7 +80,7 @@ synchronized PoolDS getByDeviceId(deviceid4 deviceId) {
}
}

synchronized Collection<Map.Entry<String,PoolDS>> getEntries() {
Collection<Map.Entry<String,PoolDS>> getEntries() {
_rlock.lock();
try {
return ImmutableSet.copyOf(_poolNameToIpMap.entrySet());
Expand Down

0 comments on commit b2575fa

Please sign in to comment.