summaryrefslogtreecommitdiff
path: root/nuttx/sched/sched_setparam.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-19 14:22:43 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-19 14:22:43 +0000
commitbf14d0a7cfb1c59f692cd24d9e97699b01e103b4 (patch)
treec94333bd8c43f9af9dcf280bf2eb76e1cf071765 /nuttx/sched/sched_setparam.c
parent35aaf2d6d6776ea47729eb80efb15e04671ab316 (diff)
downloadpx4-nuttx-bf14d0a7cfb1c59f692cd24d9e97699b01e103b4.tar.gz
px4-nuttx-bf14d0a7cfb1c59f692cd24d9e97699b01e103b4.tar.bz2
px4-nuttx-bf14d0a7cfb1c59f692cd24d9e97699b01e103b4.zip
Interrupts must be disabled in all low level context switches
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@89 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/sched_setparam.c')
-rw-r--r--nuttx/sched/sched_setparam.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/nuttx/sched/sched_setparam.c b/nuttx/sched/sched_setparam.c
index c9a935a4d..52389ae49 100644
--- a/nuttx/sched/sched_setparam.c
+++ b/nuttx/sched/sched_setparam.c
@@ -175,7 +175,9 @@ int sched_setparam(pid_t pid, const struct sched_param *param)
{
/* A context switch will occur. */
+ irqstate_t flags = irqsave();
up_reprioritize_rtr(tcb, (ubyte)sched_priority);
+ irqrestore(flags);
}
/* Otherwise, we can just change priority since it has no effect */
@@ -202,7 +204,9 @@ int sched_setparam(pid_t pid, const struct sched_param *param)
{
/* A context switch will occur. */
+ irqstate_t flags = irqsave();
up_reprioritize_rtr(tcb, (ubyte)sched_priority);
+ irqrestore(flags);
}
/* Otherwise, we can just change priority and re-schedule (since it