Re: [xml] Windows threading issues



Vakoc, Mark wrote:

So that additional define you suggest would say:
I-know-I'm-creating-a-static-libxml-but-it-will-be-used-
from-inside-a-dll-and-I-shall-call-xmlDllMain-from-my-own-DllMain

Maybe LIBXML_STATIC_FOR_DLL?

Why not just move the libxml2 thread related init and cleanup code into
functions.  Change DllMain to call these functions.  When LIBXML_STATIC
is defined then DllMain is not compiled in and the user of the static
library is responsible for calling them in their own DllMain from the
dll that uses this static library.
Why not indeed. I don't care that much...
In any case this new function is windows specific.
I imagined it would be simpler to say, "just call xmlDllMain
from inside your own DllMain, we care for everything else".

The point is: you have 2 mechanisms to cleanup TLS
- the watchdog thread, which is enabled when LIBXML_STATIC is defined
- the DllMain mechanism which is enabled when LIBXML_STATIC is not defined

Here, Jesse wants to compile with LIBXML_STATIC defined, but without
the watchdog thread.

So you probably can't avoid a new conditional.

-sbi






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]