Module: xenomai-2.5
Branch: master
Commit: 2e210511ac663881b5b6e6d34db8a9d0e498f0bf
URL:    
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=2e210511ac663881b5b6e6d34db8a9d0e498f0bf

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sun May  1 15:04:59 2011 +0200

skins: Do not return from trampolines with pthread_exit

This causes a deadlock when joining a thread from a library destructor
when the library is dlopened.

---

 src/skins/native/task.c     |    2 +-
 src/skins/posix/thread.c    |    2 +-
 src/skins/psos+/task.c      |    2 +-
 src/skins/uitron/task.c     |    2 +-
 src/skins/vrtx/task.c       |    2 +-
 src/skins/vxworks/taskLib.c |    2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/skins/native/task.c b/src/skins/native/task.c
index be4ea2c..70ba6f7 100644
--- a/src/skins/native/task.c
+++ b/src/skins/native/task.c
@@ -113,7 +113,7 @@ static void *rt_task_trampoline(void *cookie)
 
       fail:
 
-       pthread_exit((void *)err);
+       return (void *)err;
 }
 
 int rt_task_create(RT_TASK *task,
diff --git a/src/skins/posix/thread.c b/src/skins/posix/thread.c
index 109650c..81272c9 100644
--- a/src/skins/posix/thread.c
+++ b/src/skins/posix/thread.c
@@ -239,7 +239,7 @@ static void *__pthread_trampoline(void *arg)
                status = (void *)-err;
 
 out:
-       pthread_exit(status);
+       return status;
 }
 
 int __wrap_pthread_create(pthread_t *tid,
diff --git a/src/skins/psos+/task.c b/src/skins/psos+/task.c
index da3c0d5..932444e 100644
--- a/src/skins/psos+/task.c
+++ b/src/skins/psos+/task.c
@@ -107,7 +107,7 @@ static void *psos_task_trampoline(void *cookie)
 
       fail:
 
-       pthread_exit((void *)err);
+       return (void *)err;
 }
 
 u_long t_create(const char *name,
diff --git a/src/skins/uitron/task.c b/src/skins/uitron/task.c
index 05f5c18..92a7963 100644
--- a/src/skins/uitron/task.c
+++ b/src/skins/uitron/task.c
@@ -105,7 +105,7 @@ static void *uitron_task_trampoline(void *cookie)
 
       fail:
 
-       pthread_exit((void *)err);
+       return (void *)err;
 }
 
 ER cre_tsk(ID tskid, T_CTSK *pk_ctsk)
diff --git a/src/skins/vrtx/task.c b/src/skins/vrtx/task.c
index 5abc071..1dfac3e 100644
--- a/src/skins/vrtx/task.c
+++ b/src/skins/vrtx/task.c
@@ -118,7 +118,7 @@ static void *vrtx_task_trampoline(void *cookie)
          entry(arg);
        }
 fail:
-       pthread_exit((void *)err);
+       return (void *)err;
 }
 
 int sc_tecreate(void (*entry) (void *),
diff --git a/src/skins/vxworks/taskLib.c b/src/skins/vxworks/taskLib.c
index 65ab674..b77de0d 100644
--- a/src/skins/vxworks/taskLib.c
+++ b/src/skins/vxworks/taskLib.c
@@ -136,7 +136,7 @@ static void *wind_task_trampoline(void *cookie)
 
       fail:
 
-       pthread_exit((void *)err);
+       return (void *)err;
 }
 
 STATUS taskInit(WIND_TCB *pTcb,


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to