Because there's a race condition like the code describe below:
```
GetElementOfMap(key) {
  map.AutoLock();
  return map[key];
}

DeleteElementOfMap(key) {
  map.AutoLock();
  map.erase(key);
}

UpdateElementOfMap(key) {
  value = GetElementOfMap(key); 
                         // contention of value may happens here, e.g., the value could be deleted.
  {
    value.AutoLock();
    value.Update();
  }
}
```

After I change it:
```
GetAndLockElementOfMap(key) {
  map.AutoLock();
  map[key].Lock();
  return map[key];
}

UpdateElementOfMap(key) {
  value = GetAndLockElementOfMap(key); 
                         // we already hold the lock of value object
  value.Update();
  value.Unlock();
}
```