Hello,
While investigating a build failure of the "gamin" package in Buildroot on the Microblaze architecture (http://autobuild.buildroot.net/results/887/887df97196d7777efbf18a7bee91aa45c...) regarding PTHREAD_MUTEX_RECURSIVE being undefined, I noticed a discrepancy between the definition of PTHREAD_MUTEX_RECURSIVE in the linuxthreads variant of pthread.h and the NPTL variant of pthread.h. Indeed, libpthread/nptl/sysdeps/pthread/pthread.h contains:
#if defined __USE_UNIX98 || defined __USE_XOPEN2K8 , PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL #endif
while the corresponding linuxthreads version, in libpthread/linuxthreads/sysdeps/pthread/pthread.h contains:
#ifdef __USE_UNIX98 , PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL #endif
Notice how the NPTL code defines all the non-NP variants if __USE_XOPEN2K8 is defined, but not the linuxthreads version?
Maybe this difference is normal, I am not familiar enough with all the standards and conformance issues, but I thought it would be good to point it out.
Thanks,
Thomas
Hi Leonid, Thomas Petazzoni wrote,
Hello,
While investigating a build failure of the "gamin" package in Buildroot on the Microblaze architecture (http://autobuild.buildroot.net/results/887/887df97196d7777efbf18a7bee91aa45c...) regarding PTHREAD_MUTEX_RECURSIVE being undefined, I noticed a discrepancy between the definition of PTHREAD_MUTEX_RECURSIVE in the linuxthreads variant of pthread.h and the NPTL variant of pthread.h. Indeed, libpthread/nptl/sysdeps/pthread/pthread.h contains:
#if defined __USE_UNIX98 || defined __USE_XOPEN2K8 , PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL #endif
while the corresponding linuxthreads version, in libpthread/linuxthreads/sysdeps/pthread/pthread.h contains:
#ifdef __USE_UNIX98 , PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL #endif
Notice how the NPTL code defines all the non-NP variants if __USE_XOPEN2K8 is defined, but not the linuxthreads version?
Maybe this difference is normal, I am not familiar enough with all the standards and conformance issues, but I thought it would be good to point it out.
Do you have an opinion on that?
best regards Waldemar
On 7/24/16, Waldemar Brodkorb wbx@uclibc-ng.org wrote:
Hi Leonid,
Thomas Petazzoni wrote,
Notice how the NPTL code defines all the non-NP variants if __USE_XOPEN2K8 is defined, but not the linuxthreads version?
Maybe this difference is normal, I am not familiar enough with all the standards and conformance issues, but I thought it would be good to point it out.
Do you have an opinion on that?
Use of __USE_XOPEN2K8 in NPTL pthread.h come from glibc in 2010 at commit a032a65870 "mass sync with glibc nptl" Originally, it was in glibc's commit d3c7e68655 "Fix up pthread.h for XPG7." https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=d3c7e68655d65b5e68cfc...
I think that it will be good to apply this changes to linuxthreads too, but backport requires commit rework and tests.
regards, Leonid
Hi, Leonid Lisovskiy wrote,
On 7/24/16, Waldemar Brodkorb wbx@uclibc-ng.org wrote:
Hi Leonid,
Thomas Petazzoni wrote,
Notice how the NPTL code defines all the non-NP variants if __USE_XOPEN2K8 is defined, but not the linuxthreads version?
Maybe this difference is normal, I am not familiar enough with all the standards and conformance issues, but I thought it would be good to point it out.
Do you have an opinion on that?
Use of __USE_XOPEN2K8 in NPTL pthread.h come from glibc in 2010 at commit a032a65870 "mass sync with glibc nptl" Originally, it was in glibc's commit d3c7e68655 "Fix up pthread.h for XPG7." https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=d3c7e68655d65b5e68cfc...
I think that it will be good to apply this changes to linuxthreads too, but backport requires commit rework and tests.
I can do the regression testing if you cookup a patch?
best regards Waldemar
On 8/17/16, Waldemar Brodkorb wbx@uclibc-ng.org wrote:
I can do the regression testing if you cookup a patch?
First of all, we must to ask topic starter Thomas Petazzoni to check the patch after it will be cooked. Yes, I can try to prepare the patch against linuxthreads, but it will consume some time.
Regards, Leonid
Hi Leonid, Leonid Lisovskiy wrote,
On 8/17/16, Waldemar Brodkorb wbx@uclibc-ng.org wrote:
I can do the regression testing if you cookup a patch?
First of all, we must to ask topic starter Thomas Petazzoni to check the patch after it will be cooked. Yes, I can try to prepare the patch against linuxthreads, but it will consume some time.
Sure, take the time you need. I am happy some other developers are working on open issues and cleanups. No hurry :)
best regards Waldemar
Hi All!
Thomas, could you test the patch attached? It should fix the problem you mentioned.
best regards, Leonid