On 11/4/21 11:58 PM, Jefferson Carpenter wrote:
Regarding locking the DOMDocument while it is being written to:
It looks like DOMDocument is meant to be used in a single-threaded manner[1], so it should be all right to just grab an interface and not worry about threads attempting to manipulate the document while it is being written to by an mxwriter.
There are freethreaded classes as well.
For how to lock it, unless anyone has a better idea I think it would work to add an IWineXMLDOMDocumentLock interface with lock() and unlock() methods, and output a FIXME if this interface is unavailable.
I think your best bet at the moment is to load whole document at once from stream, on endDocument. Right way would probably be similar to how libxml2 does it - using SAX callbacks to construct DOM tree, and then using SAX reader when loading from stream, or writer calling them.
thanks, Jefferson
[1] https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms756987(...