Module: xenomai-forge
Branch: rtdm-api-waitqueues
Commit: d19f23a172aa299e4e215144cd4c0d70a3e661dc
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=d19f23a172aa299e4e215144cd4c0d70a3e661dc

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Apr 23 15:41:38 2014 +0200

copperplate/threadobj: fix cancel state upon start failure

---

 lib/copperplate/threadobj.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/copperplate/threadobj.c b/lib/copperplate/threadobj.c
index 5429876..a17870c 100644
--- a/lib/copperplate/threadobj.c
+++ b/lib/copperplate/threadobj.c
@@ -1082,6 +1082,8 @@ int threadobj_start(struct threadobj *thobj)      /* 
thobj->lock held. */
         * caller to forget about it as well.
         */
        if (thobj->run_state == __THREAD_S_DORMANT) {
+               /* Keep cancel-safe after unlock. */
+               thobj->cancel_state = PTHREAD_CANCEL_DISABLE;
                threadobj_unlock(thobj);
                destroy_thread(thobj);
                threadobj_free(thobj);


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

Reply via email to