VirtualBox

Changeset 8029 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Apr 16, 2008 11:36:57 AM (17 years ago)
Author:
vboxsync
Message:

Main: Reverted r29679 (some file access problems).

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/MachineImpl.cpp

    r8024 r8029  
    20322032
    20332033        /* load the config file */
    2034 #if 0
    2035         /// @todo disabled until made thread-safe by using handle duplicates
    20362034        File file (File::ReadWrite, mData->mHandleCfgFile,
    20372035                   Utf8Str (mData->mConfigFileFull));
    2038 #else
    2039         File file (File::Read, Utf8Str (mData->mConfigFileFull));
    2040 #endif
    20412036        XmlTreeBackend tree;
    20422037
     
    21392134
    21402135        /* load the config file */
    2141 #if 0
    2142         /// @todo disabled until made thread-safe by using handle duplicates
    21432136        File file (File::ReadWrite, mData->mHandleCfgFile,
    21442137                   Utf8Str (mData->mConfigFileFull));
    2145 #else
    2146         File file (File::Read, Utf8Str (mData->mConfigFileFull));
    2147 #endif
    21482138        XmlTreeBackend tree;
    21492139
     
    22172207
    22182208        /* load the config file */
    2219 #if 0
    2220         /// @todo disabled until made thread-safe by using handle duplicates
    22212209        File file (File::ReadWrite, mData->mHandleCfgFile,
    22222210                   Utf8Str (mData->mConfigFileFull));
    2223 #else
    2224         File file (File::ReadWrite, Utf8Str (mData->mConfigFileFull));
    2225 #endif
    22262211        XmlTreeBackend tree;
    22272212
     
    40204005        using namespace settings;
    40214006
    4022 #if 0
    4023         /// @todo disabled until made thread-safe by using handle duplicates
    40244007        File file (File::Read, mData->mHandleCfgFile,
    40254008                   Utf8Str (mData->mConfigFileFull));
    4026 #else
    4027         File file (File::Read, Utf8Str (mData->mConfigFileFull));
    4028 #endif
    40294009        XmlTreeBackend tree;
    40304010
     
    51615141        using namespace settings;
    51625142
    5163 #if 0
    5164         /// @todo disabled until made thread-safe by using handle duplicates
    51655143        File file (File::ReadWrite, mData->mHandleCfgFile,
    51665144                   Utf8Str (mData->mConfigFileFull));
    5167 #else
    5168         File file (File::ReadWrite, Utf8Str (mData->mConfigFileFull));
    5169 #endif
    51705145        XmlTreeBackend tree;
    51715146
     
    53735348
    53745349        /* load the config file */
    5375 #if 0
    5376         /// @todo disabled until made thread-safe by using handle duplicates
    53775350        File file (File::ReadWrite, mData->mHandleCfgFile,
    53785351                   Utf8Str (mData->mConfigFileFull));
    5379 #else
    5380         File file (File::ReadWrite, Utf8Str (mData->mConfigFileFull));
    5381 #endif
    53825352        XmlTreeBackend tree;
    53835353
     
    59555925
    59565926        /* load the config file */
    5957 #if 0
    5958         /// @todo disabled until made thread-safe by using handle duplicates
    59595927        File file (File::ReadWrite, mData->mHandleCfgFile,
    59605928                   Utf8Str (mData->mConfigFileFull));
    5961 #else
    5962         File file (File::ReadWrite, Utf8Str (mData->mConfigFileFull));
    5963 #endif
    59645929        XmlTreeBackend tree;
    59655930
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r8020 r8029  
    206206            using namespace settings;
    207207
    208 #if 0
    209             /// @todo disabled until made thread-safe by using handle duplicates
    210208            File file (File::ReadWrite, mData.mCfgFile.mHandle, vboxConfigFile);
    211 #else
    212             File file (File::Read, vboxConfigFile);
    213 #endif
    214209            XmlTreeBackend tree;
    215210
     
    17141709
    17151710        /* load the config file */
    1716 #if 0
    1717         /// @todo disabled until made thread-safe by using handle duplicates
    17181711        File file (File::ReadWrite, mData.mCfgFile.mHandle,
    17191712                   Utf8Str (mData.mCfgFile.mName));
    1720 #else
    1721         File file (File::Read, Utf8Str (mData.mCfgFile.mName));
    1722 #endif
    17231713        XmlTreeBackend tree;
    17241714
     
    18171807
    18181808        /* load the config file */
    1819 #if 0
    1820         /// @todo disabled until made thread-safe by using handle duplicates
    18211809        File file (File::ReadWrite, mData.mCfgFile.mHandle,
    18221810                   Utf8Str (mData.mCfgFile.mName));
    1823 #else
    1824         File file (File::Read, Utf8Str (mData.mCfgFile.mName));
    1825 #endif
    18261811        XmlTreeBackend tree;
    18271812
     
    18821867
    18831868        /* load the config file */
    1884 #if 0
    1885         /// @todo disabled until made thread-safe by using handle duplicates
    18861869        File file (File::ReadWrite, mData.mCfgFile.mHandle,
    18871870                   Utf8Str (mData.mCfgFile.mName));
    1888 #else
    1889         File file (File::ReadWrite, Utf8Str (mData.mCfgFile.mName));
    1890 #endif
    18911871        XmlTreeBackend tree;
    18921872
     
    37413721        using namespace settings;
    37423722
    3743 #if 0
    3744         /// @todo disabled until made thread-safe by using handle duplicates
    37453723        File file (File::ReadWrite, mData.mCfgFile.mHandle,
    37463724                   Utf8Str (mData.mCfgFile.mName));
    3747 #else
    3748         File file (File::ReadWrite, Utf8Str (mData.mCfgFile.mName));
    3749 #endif
    37503725        XmlTreeBackend tree;
    37513726
  • trunk/src/VBox/Main/xml/Settings.cpp

    r8020 r8029  
    2121#include <iprt/err.h>
    2222#include <iprt/file.h>
    23 #include <iprt/lock.h>
    2423
    2524#include <libxml/tree.h>
     
    7574    {
    7675        xmlExternalEntityLoader defaultEntityLoader;
    77 
    78         /** Used to provide some thread safety missing in libxml2 (see e.g.
    79          *  XmlTreeBackend::read()) */
    80         RTLockMtx lock;
    8176    }
    8277    xml;
     
    387382}
    388383
    389 #if 0
    390 /// @todo disabled until made thread-safe by using handle duplicates
    391 File::File (Mode aMode, RTFILE aHandle, const char *aFileName)
     384File::File (Mode aMode, RTFILE aHandle, const char *aFileName /* = NULL */ )
    392385    : m (new Data())
    393386{
     
    407400    setPos (0);
    408401}
    409 #endif
    410402
    411403File::~File()
     
    911903    m->trappedErr.reset();
    912904
    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).*/
    921912    xmlExternalEntityLoader oldEntityLoader = xmlGetExternalEntityLoader();
    922913    sThat = this;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette