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

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

copperplate/threadobj: require thread lock on entry to threadobj_set_periodic()

---

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

diff --git a/lib/copperplate/threadobj.c b/lib/copperplate/threadobj.c
index 8f76618..0d3274f 100644
--- a/lib/copperplate/threadobj.c
+++ b/lib/copperplate/threadobj.c
@@ -334,7 +334,9 @@ static int set_rr(struct threadobj *thobj, const struct 
timespec *quantum)
 int threadobj_set_periodic(struct threadobj *thobj,
                           const struct timespec *__restrict__ idate,
                           const struct timespec *__restrict__ period)
-{
+{                              /* thobj->lock held */
+       __threadobj_check_locked(thobj);
+
        return -pthread_make_periodic_np(thobj->tid,
                                         CLOCK_COPPERPLATE, idate, period);
 }
@@ -734,9 +736,11 @@ static int set_rr(struct threadobj *thobj, const struct 
timespec *quantum)
 int threadobj_set_periodic(struct threadobj *thobj,
                           const struct timespec *__restrict__ idate,
                           const struct timespec *__restrict__ period)
-{
+{                              /* thobj->lock held */
        struct timespec now, wakeup;
 
+       __threadobj_check_locked(thobj);
+
        clock_gettime(CLOCK_COPPERPLATE, &now);
 
        if (idate->tv_sec || idate->tv_nsec) {


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

Reply via email to