From 642eadd6b82daaeeb3247c2417bf58d113639a1c Mon Sep 17 00:00:00 2001 From: Glenn Elliott Date: Tue, 8 Jan 2013 18:19:43 -0500 Subject: Extend non-rt support to sync-releases. Note that non-rt tasks are released immediately. That is, the 'delay' provided to the release_ts() system-call is ignored for non-rt tasks. --- litmus/sync.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/litmus/sync.c b/litmus/sync.c index bf75fde5450b..9fb6366f002f 100644 --- a/litmus/sync.c +++ b/litmus/sync.c @@ -65,7 +65,11 @@ static long do_release_ts(lt_t start) struct __wait_queue, task_list)->private; task_count++; - litmus->release_at(t, start + t->rt_param.task_params.phase); + /* RT tasks can be delayed. Non-RT tasks are released + immediately. */ + if (is_realtime(t)) { + litmus->release_at(t, start + t->rt_param.task_params.phase); + } sched_trace_task_release(t); } @@ -80,10 +84,8 @@ static long do_release_ts(lt_t start) asmlinkage long sys_wait_for_ts_release(void) { long ret = -EPERM; - struct task_struct *t = current; - if (is_realtime(t)) - ret = do_wait_for_ts_release(); + ret = do_wait_for_ts_release(); return ret; } @@ -97,8 +99,11 @@ asmlinkage long sys_release_ts(lt_t __user *__delay) /* FIXME: check capabilities... */ ret = copy_from_user(&delay, __delay, sizeof(delay)); - if (ret == 0) + if (ret == 0) { + /* Note: Non-rt tasks that participate in a sync release cannot be + delayed. They will be released immediately. */ ret = do_release_ts(litmus_clock() + delay); + } return ret; } -- cgit v1.2.2