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

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 17f5d4a..ae1970a 100644
--- a/lib/copperplate/threadobj.c
+++ b/lib/copperplate/threadobj.c
@@ -1074,6 +1074,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