INtime SDK Help
SuspendRtThread
INtime SDK v7.1 > About INtime > INtime Kernel > Threads > SuspendRtThread

Increases by one the suspension depth of a specified thread.

If the specified thread is already in either the suspended or asleep-suspended state, its state does not change.

If the thread is in the ready or running state, it enters the suspended state.

If the thread is in the asleep state, it enters the asleep-suspended state.

You cannot use SuspendRtThread to suspend interrupt threads. Also, a thread should not try to suspend itself while accessing a region because this locks the region and memory used by the thread, and the thread cannot run again.

Notes:
  • To synchronize threads, use mailboxes or semaphores rather than using SuspendRtThread to suspend another thread.
  • Never suspend a thread in a system call. Do not use threads to suspend another thread unless the state of the suspended thread is completely understood. This call can lead to deadlock.
BOOLEAN SuspendRtThread(

RTHANDLE hThread // handle for the thread to be suspended
);

Parameters

hThread
Handle for the thread which is to be suspended.
The value NULL_RTHANDLE suspends the calling thread.

Return Values

TRUE
Success.
FALSE
Failure. To determine the status, call GetLastRtError.

Status

E_OK 0x0000
No exceptional conditions occurred.
E_LIMIT 0x0004
The suspension depth for the specified thread already reached the maximum of 254.
E_CONTEXT 0x0005
hThread specifies an interrupt thread.
E_EXIST 0x0006
You used an invalid value for hThread.
E_TYPE 0x8002
A thread cannot use hThread as an RT handle.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/rtbase.h rt.h rt.lib
See Also