aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/locking.c
diff options
context:
space:
mode:
Diffstat (limited to 'litmus/locking.c')
-rw-r--r--litmus/locking.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/litmus/locking.c b/litmus/locking.c
index 12a23eb715cc..16c936ba8139 100644
--- a/litmus/locking.c
+++ b/litmus/locking.c
@@ -540,6 +540,35 @@ out:
540 return passed; 540 return passed;
541} 541}
542 542
543
544void suspend_for_lock(void)
545{
546#ifdef CONFIG_REALTIME_AUX_TASKS
547 unsigned int restore = 0;
548 struct task_struct *t = current;
549 unsigned int hide;
550
551 if (tsk_rt(t)->has_aux_tasks) {
552 /* hide from aux tasks so they can't inherit our priority when we block
553 * for a litmus lock. inheritance is already going to a litmus lock
554 * holder. */
555 hide = tsk_rt(t)->hide_from_aux_tasks;
556 restore = 1;
557 tsk_rt(t)->hide_from_aux_tasks = 1;
558 }
559#endif
560
561 schedule();
562
563#ifdef CONFIG_REALTIME_AUX_TASKS
564 if (restore) {
565 /* restore our state */
566 tsk_rt(t)->hide_from_aux_tasks = hide;
567 }
568#endif
569}
570
571
543#else // CONFIG_LITMUS_LOCKING 572#else // CONFIG_LITMUS_LOCKING
544 573
545struct fdso_ops generic_lock_ops = {}; 574struct fdso_ops generic_lock_ops = {};