Module: xenomai-2.6
Branch: master
Commit: 60957fb42f76275c2851c5720b65ce60fbd3e75d
URL:    
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=60957fb42f76275c2851c5720b65ce60fbd3e75d

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Wed Jun 12 08:09:06 2013 +0200

posix: Skip auto-shadowing if current thread is already shadowed

While the user can also avoid double shadowing by providing the
XENO_NOSHADOW environment variable, there is still no reason to attempt
auto-shadowing in their absence if the current thread is already a
Xenomai thread. This helps, e.g., in complex dlopen scenarios where
the POSIX lib is pulled in belatedly, potentially after some other lib
already shadowed the dlopen caller.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 src/skins/posix/init.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/skins/posix/init.c b/src/skins/posix/init.c
index 80725c5..ca1d9e1 100644
--- a/src/skins/posix/init.c
+++ b/src/skins/posix/init.c
@@ -31,6 +31,7 @@
 #include <rtdk.h>
 
 #include <asm-generic/xenomai/bind.h>
+#include <asm-generic/xenomai/current.h>
 
 int __pse51_muxid = -1;
 int __pse51_rtdm_muxid = -1;
@@ -67,7 +68,7 @@ static __constructor__ void __init_posix_interface(void)
        }
 
        noshadow = getenv("XENO_NOSHADOW");
-       if (!noshadow || !*noshadow) {
+       if ((!noshadow || !*noshadow) && xeno_get_current() == XN_NO_HANDLE) {
                err = __real_pthread_getschedparam(pthread_self(), &policy,
                                                   &parm);
                if (err) {


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to