tslp_tsk

Outline

Put task to sleep (with time-out).

C format

 ER      tslp_tsk (TMO tmout);
Parameter(s)

I/O

Parameter

Description

I

 TMO     tmout;
Specified time-out (in millisecond).

TMO_FEVR: Waiting forever.

TMO_POL: Polling.

Value: Specified time-out.



Explanation

This service call moves the invoking task from the RUNNING state to the WAITING state (sleeping state).

As a result, the invoking task is unlinked from the ready queue and excluded from the RI600PX scheduling subject.

If a wake-up request has been queued to the target task (the wake-up request counter > 0) when this service call is issued, this service call does not move the state but decrements the wake-up request counter (by subtracting 1 from the wake-up request counter).

The sleeping state is cancelled in the following cases.

Sleeping State Cancel Operation

Return Value

A wake-up request was issued as a result of issuing wup_tsk.

E_OK

A wake-up request was issued as a result of issuing iwup_tsk.

E_OK

Forced release from waiting (accept rel_wai while waiting).

E_RLWAI

Forced release from waiting (accept irel_wai while waiting).

E_RLWAI

The time specified by tmout has elapsed.

E_TMOUT



Note When TMO_FEVR is specified for wait time tmout, processing equivalent to slp_tsk will be executed.

Return value

Macro

Value

Description

E_OK

0

Normal completion.

E_PAR

-17

Parameter error.

- tmout < -1

- tmout > (0x7FFFFFFF - TIC_NUME) / TIC_DENO

E_CTX

-25

Context error.

- This service call was issued from a non-task.

- This service call was issued in the CPU locked state.

- This service call was issued in the dispatching disabled state.

- This service call was issued in the status "PSW.IPL > kernel interrupt mask level".

E_MACV

-26

Memory access violation.

- Stack pointer points out of user stack for invoking task.

E_RLWAI

-49

Forced release from the WAITING state.

- Accept rel_wai/irel_wai while waiting.

E_TMOUT

-50

Polling failure or specified time has elapsed.