Download RI78V4 Real-Time Operating System User`s Manual: Coding
Transcript
RI78V4
4.7
CHAPTER 4 TASK DEPENDENT SYNCHRONIZATION FUNCTIONS
Resume Suspended Task
The SUSPENDED state is cancelled by issuing the following service call from the processing program.
- rsm_tsk, irsm_tsk
This service call subtracts 0x1 from the suspend request counter for the task specified by parameter tskid, and then
cancels the SUSPENDED state of the target task.
As a result, the target task is moved from the SUSPENDED state to the READY state, or from the WAITINGSUSPENDED state to the WAITING state.
If a suspend request is queued (subtraction result is other than 0x0) when this service call is issued, the counter
manipulation processing is not performed but only the suspend request counter decrement processing is executed.
The following describes an example for coding this service call.
#pragma
rtos_task
func_task
#include
#include
<kernel.h>
<kernel_id.h>
void
func_task ( VP_INT exinf )
{
ID
tskid = ID_tskA;
/*Standard header file definition*/
/*System information header file definition*/
/*Declares and initializes variable*/
/* ............ */
rsm_tsk ( tskid );
/*Resume suspended task*/
/* ............ */
}
Note 1
If the target task is moved to the READY state after this service call is issued, this service call also re-queues
the task at the end of the ready queue corresponding to the priority of the task.
Note 2
This service call does not perform queuing of cancellation requests. If the target task is in a state other than
the SUSPENDED or WAITING-SUSPENDED state, "E_OBJ" is therefore returned.
R20UT0511EJ0101 Rev.1.01
Apr 01, 2012
Page 41 of 272