Changeset 8020 in vbox for trunk/include
- Timestamp:
- Apr 16, 2008 10:14:39 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 29679
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/settings.h
r7388 r8020 81 81 * Making deep copies or detaching the existing shallow copy from its original 82 82 * is not yet supported. 83 * 84 * Note that the Settings File API is not thread-safe. It means that if you 85 * want to use the same instance of a class from the settings namespace on more 86 * than one thread at a time, you will have to provide necessary access 87 * serialization yourself. 83 88 * 84 89 * Due to some (not propely studied) libxml2 limitations, the Settings File … … 1171 1176 * regular files. 1172 1177 * 1173 * The File class uses IPRT File API for file operations. 1178 * The File class uses IPRT File API for file operations. Note that IPRT File 1179 * API is not thread-safe. This means that if you pass the same RTFILE handle to 1180 * different File instances that may be simultaneously used on different 1181 * threads, you should care about serialization; otherwise you will get garbage 1182 * when reading from such File instances. 1183 * 1184 * @todo We should duplicate file handles (once this API is in IPRT) passed to 1185 * constructors to provide thread-safety. 1174 1186 */ 1175 1187 class VBOXSETTINGS_CLASS File : public Input, public Output … … 1192 1204 File (Mode aMode, const char *aFileName); 1193 1205 1206 #if 0 1207 /// @todo disabled until made thread-safe by using handle duplicates 1194 1208 /** 1195 1209 * Uses the given file handle to perform file operations. The given file … … 1204 1218 * this object destruction. 1205 1219 * 1220 * @note It you pass the same RTFILE handle to more than one File instance, 1221 * please make sure you have provided serialization in case if these 1222 * instasnces are to be simultaneously used by different threads. 1223 * Otherwise you may get garbage when reading or writing. 1224 * 1206 1225 * @param aHandle Open file handle. 1207 1226 * @param aMode File mode of the open file handle. 1208 * @param aFileName File name (for reference). 1209 */ 1210 File (Mode aMode, RTFILE aHandle, const char *aFileName = NULL); 1227 * @param aFileName File name (for reference, may be NULL). 1228 */ 1229 File (Mode aMode, RTFILE aHandle, const char *aFileName); 1230 #endif 1211 1231 1212 1232 /** … … 1282 1302 /** 1283 1303 * The XmlTreeBackend class uses XML markup to store settings trees. 1304 * 1305 * @note libxml2 and libxslt libraries used by the XmlTreeBackend are not 1306 * fully reentrant. To "fix" this, the XmlTreeBackend backend serializes access 1307 * to such non-reentrant parts using a global mutex so that only one thread can 1308 * use non-reentrant code at a time. Currently, this relates to the #rawRead() 1309 * method (and to #read() as a consequence). This menas that only one thread can 1310 * parse an XML stream at a time; other threads trying to parse same or 1311 * different streams using different XmlTreeBackend and Input instances 1312 * will have to wait. 1313 * 1314 * Keep in mind that the above reentrancy fix does not imply thread-safety: it 1315 * is still the caller's responsibility to provide serialization if the same 1316 * XmlTreeBackend instnace (as well as instances of other classes from the 1317 * settings namespace) needs to be used by more than one thread. 1284 1318 */ 1285 1319 class VBOXSETTINGS_CLASS XmlTreeBackend : public TreeBackend
Note:
See TracChangeset
for help on using the changeset viewer.