diff options
Diffstat (limited to 'litmus/sync.c')
-rw-r--r-- | litmus/sync.c | 21 |
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); |