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
);
hThread
TRUE
FALSE
E_OK 0x0000
E_LIMIT 0x0004
E_CONTEXT 0x0005
hThread
specifies an interrupt thread.
E_EXIST 0x0006
hThread
.
E_TYPE 0x8002
hThread
as an RT handle. Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 | intime/rt/include/rtbase.h | rt.h | rt.lib |