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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed May  7 12:25:27 2014 +0200

copperplate/threadobj: require local thread for threadobj_set_rr()

We enforce process locality for target threads since both Cobalt and
Mercury need this internally.

This seems an acceptable limitation compared to introducing a
significantly more complex implementation only for supporting a
somewhat weird feature (i.e. controlling the round-robin state of
remote threads).

---

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

diff --git a/lib/copperplate/threadobj.c b/lib/copperplate/threadobj.c
index 0d3274f..1908d86 100644
--- a/lib/copperplate/threadobj.c
+++ b/lib/copperplate/threadobj.c
@@ -1316,6 +1316,16 @@ int threadobj_set_rr(struct threadobj *thobj, const 
struct timespec *quantum)
        __threadobj_check_locked(thobj);
 
        /*
+        * XXX: we enforce locality since both Cobalt and Mercury need
+        * this for set_rr(). This seems an acceptable limitation
+        * compared to introducing a significantly more complex
+        * implementation only for supporting a somewhat weird feature
+        * (i.e. controlling the round-robin state of remote threads).
+        */
+       if (!threadobj_local_p(thobj))
+               return -EINVAL;
+
+       /*
         * It makes no sense to enable/disable round-robin while
         * holding the scheduler lock. Prevent this, which makes our
         * logic simpler in the Mercury case with respect to tracking


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

Reply via email to