Re: [xml] LIBXML_THREAD_ENABLED and HAVE_PTHREAD_H mismatch
- From: Roumen Petrov <bugtrack roumenpetrov info>
- To: xml gnome org
- Subject: Re: [xml] LIBXML_THREAD_ENABLED and HAVE_PTHREAD_H mismatch
- Date: Mon, 22 Nov 2010 00:56:24 +0200
Adrian Bunk wrote:
On Fri, Nov 19, 2010 at 10:00:38PM +0200, Roumen Petrov wrote:
[SNIP]
Kwasi Mensah wrote:
I ran into the issue where HAVE_PTHREAD_H is defined but
LIBXML_THREAD_ENABLED wasn't. The fix was already submitted as per
http://mail.gnome.org/archives/xml/2005-August/msg00136.html .
Out of curiosity, is there a reason this patch didn't get into that main
line?
This is with libxml2 2.7.8 on Mac OS X. I ran the configure script but
[SNIP]
In summary :
- gcc -pthread defines _REENTRANT on linux
- gcc -pthread does not define preprocesor macros on FreeBSD and OS
X(darwin).
I guess other BSDs to be similar as FreeBSD.
No Idea how to resolve properly issue.
The proper solution would be to:
- get rid of the #if's in xmlversion.h.in and
- set one threads variable in configure.ac when using threads and
- *if* that variable is set, set an additional variable in
configure.ac specifying which threads type is used
As Daniel is author of the code I would like to leave to him to detail.
Lets see the code
#if @WITH_THREADS@
# if XXX
....
# endif /*XXX*/
#endif
as @WITH_THREADS@ depend from configure script/settings/detection.
If i understand properly if libxml is compiled :
- without threading support to forbid third party to use threading. In
this case @WITH_THREADS@ will be zero and nested if are not applicable.
- with threading support to enable/disable threading for third party
depending from some flags. In this case @WITH_THREADS@ will be one and
nested #if is applicable.
The issue is with second case - how thread aware libxml to detect that
third party application/library require threading.
Roumen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]