Changeset 8029 in vbox for trunk/src/VBox/Main
- Timestamp:
- Apr 16, 2008 11:36:57 AM (17 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r8024 r8029 2032 2032 2033 2033 /* load the config file */ 2034 #if 02035 /// @todo disabled until made thread-safe by using handle duplicates2036 2034 File file (File::ReadWrite, mData->mHandleCfgFile, 2037 2035 Utf8Str (mData->mConfigFileFull)); 2038 #else2039 File file (File::Read, Utf8Str (mData->mConfigFileFull));2040 #endif2041 2036 XmlTreeBackend tree; 2042 2037 … … 2139 2134 2140 2135 /* load the config file */ 2141 #if 02142 /// @todo disabled until made thread-safe by using handle duplicates2143 2136 File file (File::ReadWrite, mData->mHandleCfgFile, 2144 2137 Utf8Str (mData->mConfigFileFull)); 2145 #else2146 File file (File::Read, Utf8Str (mData->mConfigFileFull));2147 #endif2148 2138 XmlTreeBackend tree; 2149 2139 … … 2217 2207 2218 2208 /* load the config file */ 2219 #if 02220 /// @todo disabled until made thread-safe by using handle duplicates2221 2209 File file (File::ReadWrite, mData->mHandleCfgFile, 2222 2210 Utf8Str (mData->mConfigFileFull)); 2223 #else2224 File file (File::ReadWrite, Utf8Str (mData->mConfigFileFull));2225 #endif2226 2211 XmlTreeBackend tree; 2227 2212 … … 4020 4005 using namespace settings; 4021 4006 4022 #if 04023 /// @todo disabled until made thread-safe by using handle duplicates4024 4007 File file (File::Read, mData->mHandleCfgFile, 4025 4008 Utf8Str (mData->mConfigFileFull)); 4026 #else4027 File file (File::Read, Utf8Str (mData->mConfigFileFull));4028 #endif4029 4009 XmlTreeBackend tree; 4030 4010 … … 5161 5141 using namespace settings; 5162 5142 5163 #if 05164 /// @todo disabled until made thread-safe by using handle duplicates5165 5143 File file (File::ReadWrite, mData->mHandleCfgFile, 5166 5144 Utf8Str (mData->mConfigFileFull)); 5167 #else5168 File file (File::ReadWrite, Utf8Str (mData->mConfigFileFull));5169 #endif5170 5145 XmlTreeBackend tree; 5171 5146 … … 5373 5348 5374 5349 /* load the config file */ 5375 #if 05376 /// @todo disabled until made thread-safe by using handle duplicates5377 5350 File file (File::ReadWrite, mData->mHandleCfgFile, 5378 5351 Utf8Str (mData->mConfigFileFull)); 5379 #else5380 File file (File::ReadWrite, Utf8Str (mData->mConfigFileFull));5381 #endif5382 5352 XmlTreeBackend tree; 5383 5353 … … 5955 5925 5956 5926 /* load the config file */ 5957 #if 05958 /// @todo disabled until made thread-safe by using handle duplicates5959 5927 File file (File::ReadWrite, mData->mHandleCfgFile, 5960 5928 Utf8Str (mData->mConfigFileFull)); 5961 #else5962 File file (File::ReadWrite, Utf8Str (mData->mConfigFileFull));5963 #endif5964 5929 XmlTreeBackend tree; 5965 5930 -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r8020 r8029 206 206 using namespace settings; 207 207 208 #if 0209 /// @todo disabled until made thread-safe by using handle duplicates210 208 File file (File::ReadWrite, mData.mCfgFile.mHandle, vboxConfigFile); 211 #else212 File file (File::Read, vboxConfigFile);213 #endif214 209 XmlTreeBackend tree; 215 210 … … 1714 1709 1715 1710 /* load the config file */ 1716 #if 01717 /// @todo disabled until made thread-safe by using handle duplicates1718 1711 File file (File::ReadWrite, mData.mCfgFile.mHandle, 1719 1712 Utf8Str (mData.mCfgFile.mName)); 1720 #else1721 File file (File::Read, Utf8Str (mData.mCfgFile.mName));1722 #endif1723 1713 XmlTreeBackend tree; 1724 1714 … … 1817 1807 1818 1808 /* load the config file */ 1819 #if 01820 /// @todo disabled until made thread-safe by using handle duplicates1821 1809 File file (File::ReadWrite, mData.mCfgFile.mHandle, 1822 1810 Utf8Str (mData.mCfgFile.mName)); 1823 #else1824 File file (File::Read, Utf8Str (mData.mCfgFile.mName));1825 #endif1826 1811 XmlTreeBackend tree; 1827 1812 … … 1882 1867 1883 1868 /* load the config file */ 1884 #if 01885 /// @todo disabled until made thread-safe by using handle duplicates1886 1869 File file (File::ReadWrite, mData.mCfgFile.mHandle, 1887 1870 Utf8Str (mData.mCfgFile.mName)); 1888 #else1889 File file (File::ReadWrite, Utf8Str (mData.mCfgFile.mName));1890 #endif1891 1871 XmlTreeBackend tree; 1892 1872 … … 3741 3721 using namespace settings; 3742 3722 3743 #if 03744 /// @todo disabled until made thread-safe by using handle duplicates3745 3723 File file (File::ReadWrite, mData.mCfgFile.mHandle, 3746 3724 Utf8Str (mData.mCfgFile.mName)); 3747 #else3748 File file (File::ReadWrite, Utf8Str (mData.mCfgFile.mName));3749 #endif3750 3725 XmlTreeBackend tree; 3751 3726 -
trunk/src/VBox/Main/xml/Settings.cpp
r8020 r8029 21 21 #include <iprt/err.h> 22 22 #include <iprt/file.h> 23 #include <iprt/lock.h>24 23 25 24 #include <libxml/tree.h> … … 75 74 { 76 75 xmlExternalEntityLoader defaultEntityLoader; 77 78 /** Used to provide some thread safety missing in libxml2 (see e.g.79 * XmlTreeBackend::read()) */80 RTLockMtx lock;81 76 } 82 77 xml; … … 387 382 } 388 383 389 #if 0 390 /// @todo disabled until made thread-safe by using handle duplicates 391 File::File (Mode aMode, RTFILE aHandle, const char *aFileName) 384 File::File (Mode aMode, RTFILE aHandle, const char *aFileName /* = NULL */ ) 392 385 : m (new Data()) 393 386 { … … 407 400 setPos (0); 408 401 } 409 #endif410 402 411 403 File::~File() … … 911 903 m->trappedErr.reset(); 912 904 913 /* We use the global lock for the whole duration of this method to serialize 914 * access to thread-unsafe xmlGetExternalEntityLoader() and some other 915 * calls. It means that only one thread is able to parse an XML stream at a 916 * time but another choice would be to patch libxml2/libxslt which is 917 * unwanted now for several reasons. Search for "thread-safe" to find all 918 * unsafe cases. */ 919 RTLock alock (gGlobal.xml.lock); 920 905 /* Set up the external entity resolver. Note that we do it in a 906 * thread-unsafe fashion because this stuff is not thread-safe in libxml2. 907 * Making it thread-safe would require a) guarding this method with a 908 * mutex and b) requiring our API caller not to use libxml2 on some other 909 * thread (which is not practically possible). So, our API is not 910 * thread-safe for now (note that there are more thread-unsafe assumptions 911 * below like xsltGenericError which is also a libxslt limitation).*/ 921 912 xmlExternalEntityLoader oldEntityLoader = xmlGetExternalEntityLoader(); 922 913 sThat = this;
Note:
See TracChangeset
for help on using the changeset viewer.