On Fri, Apr 27, 2007 at 12:10:53AM +0300, Vlad Gusev wrote:
> Dear Daniel,
> 
> Honestly, I spent no time to check my problems with libxml2 in the bug list
> properly
> and found the only close topic in
> <http://mail.gnome.org/archives/xml/2007-February/msg00064.html>
> http://mail.gnome.org/archives/xml/2007-February/msg00064.html.
> 
> Let me shortly explain the problem. Look, please, at the code sequence
> starting from xmlReadFile:
> 
> xmlReadFile  
>     xmlCreateURLParserCtxt
>         xmlNewParserCtxt
>             xmlInitParserCtxt
>                 xmlDefaultSAXHandlerInit
>     xmlDoRead
>         xmlParseDocument
>             xmlInitParser
>                 xmlInitThreads
>                     InitializeCriticalSection(&cleanup_helpers_cs)
>                 xmlDefaultSAXHandlerInit
> ...etc...
>  
> Thus, there are two calls of xmlDefaultSAXHandlerInit causing in its turn:
>  
> xmlDefaultSAXHandlerInit 
>     __htmlDefaultSAXHandler
>         xmlGetGlobalState
>             EnterCriticalSection(&cleanup_helpers_cs)
>  
> under condition of not main thread. That is the first call of
> xmlDefaultSAXHandlerInit can access the critical section
> with no initializing it while the second one is ok.

  Have you read the associated doc ?
    http://xmlsoft.org/threads.html 

 call xmlInitParser() in the "main" thread before using any of the libxml2 API 
and especially before calling xmlReadFile, the critical section should then be
initialized.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to