- Timestamp:
- Jul 15, 2019 1:25:42 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r79742 r79793 8034 8034 8035 8035 DECLCALLBACK(int) Medium::i_vdConfigUpdate(void *pvUser, 8036 bool fCreate, 8037 const char *pszName, 8038 const char *pszValue) 8039 { 8036 bool fCreate, 8037 const char *pszName, 8038 const char *pszValue) 8039 { 8040 Medium *that = (Medium *)pvUser; 8041 8042 // Detect if this runs inside i_queryInfo() on the current thread. 8043 // Skip if not. Check does not need synchronization. 8044 if (!that->m || !that->m->queryInfoRunning || !that->m->queryInfoSem.isWriteLockOnCurrentThread()) 8045 return VINF_SUCCESS; 8046 8047 // It's guaranteed that this code is executing inside Medium::i_queryInfo, 8048 // can assume it took care of synchronization. 8040 8049 int rv = VINF_SUCCESS; 8041 Utf8Str pName = Utf8Str(pszName); 8042 Medium *that = (Medium *)pvUser; 8043 AutoWriteLock mlock(that COMMA_LOCKVAL_SRC_POS); 8044 settings::StringsMap::const_iterator it = that->m->mapProperties.find(pName); 8050 Utf8Str strName(pszName); 8051 settings::StringsMap::const_iterator it = that->m->mapProperties.find(strName); 8045 8052 if (it == that->m->mapProperties.end() && !fCreate) 8046 8053 rv = VERR_CFGM_VALUE_NOT_FOUND; 8047 8054 else 8048 that->m->mapProperties[pName] = Utf8Str(pszValue); 8049 mlock.release(); 8055 that->m->mapProperties[strName] = Utf8Str(pszValue); 8050 8056 return rv; 8051 8057 }
Note:
See TracChangeset
for help on using the changeset viewer.