Module: xenomai-forge
Branch: next
Commit: 7d61c95e1ad67d25cc9e18c76535194462ebe3bc
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=7d61c95e1ad67d25cc9e18c76535194462ebe3bc

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