aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/sync.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2013-04-13 13:47:02 -0400
committerGlenn Elliott <gelliott@cs.unc.edu>2013-04-13 13:47:02 -0400
commit5318fb805306b52530c5139cc3fe8b64c1926df8 (patch)
tree8ca80838f32ca9fa510b2a029fc280865ac67340 /litmus/sync.c
parent2f253d08ae00a9cf60c15e0cc5af560f75b3df2a (diff)
parent4ffefb822b9d65d4efbedb60e3c9a0e76895cc5b (diff)
Merge branch 'gh/prop/completion-fix' into wip-2012.3-gpu-rtss13
Conflicts: include/litmus/budget.h litmus/sched_cedf.c litmus/sync.c
Diffstat (limited to 'litmus/sync.c')
-rw-r--r--litmus/sync.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/litmus/sync.c b/litmus/sync.c
index 01ea5d52f84b..93b7207b9361 100644
--- a/litmus/sync.c
+++ b/litmus/sync.c
@@ -55,14 +55,23 @@ static long do_wait_for_ts_release(struct timespec *wake)
55 + current->rt_param.task_params.phase; 55 + current->rt_param.task_params.phase;
56 *wake = ns_to_timespec(phasedRelease); 56 *wake = ns_to_timespec(phasedRelease);
57 57
58 /* Completion succeeded, setup release. */ 58 /* Setting this flag before releasing ensures that this CPU
59 litmus->release_at(current, phasedRelease 59 * will be the next CPU to requeue the task on a ready or
60 - current->rt_param.task_params.period); 60 * release queue.
61 /* trigger advance to next job release at the programmed time */ 61 */
62 ret = complete_job(); 62 tsk_rt(current)->completed = 1;
63 mb();
64
65 /* completion succeeded, set up release. subtract off
66 * period because schedule()->job_completion() will
67 * advances us to the correct time */
68 litmus->release_at(current,
69 phasedRelease - current->rt_param.task_params.period);
70 schedule();
63 } 71 }
64 else 72 else {
65 *wake = ns_to_timespec(wait.ts_release_time); 73 *wake = ns_to_timespec(wait.ts_release_time);
74 }
66 } else { 75 } else {
67 /* We were interrupted, must cleanup list. */ 76 /* We were interrupted, must cleanup list. */
68 mutex_lock(&task_release_lock); 77 mutex_lock(&task_release_lock);