summaryrefslogtreecommitdiffstats
path: root/c/src/exec/itron/src/rot_rdq.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/exec/itron/src/rot_rdq.c')
-rw-r--r--c/src/exec/itron/src/rot_rdq.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/c/src/exec/itron/src/rot_rdq.c b/c/src/exec/itron/src/rot_rdq.c
index b329313946..ac6d89d55f 100644
--- a/c/src/exec/itron/src/rot_rdq.c
+++ b/c/src/exec/itron/src/rot_rdq.c
@@ -24,6 +24,26 @@ ER rot_rdq(
PRI tskpri
)
{
+ PRI priority;
+
+
+ _Thread_Disable_dispatch();
+
+ /*
+ * Yield of processor will rotate the queue for this processor.
+ */
+
+ if (( tskpri <= 0 ) || ( tskpri >= 256 ))
+ _ITRON_return_errorno( E_PAR );
+
+ priority = _ITRON_Task_Core_to_Priority(_Thread_Executing->current_priority);
+ if ( priority == tskpri )
+ _Thread_Yield_processor();
+ else {
+ _Thread_Rotate_Ready_Queue( _ITRON_Task_Core_to_Priority( tskpri ) );
+ }
+ _Thread_Enable_dispatch();
+
return E_OK;
}