Creates a thread to execute within the context of the calling process.
RTHANDLE CreateRtThread(
BYTE byPriority, // thread initial priority
LPPROC lpEntry, // pointer to thread entry point
DWORD dwStackSize, // size of new thread's stack
LPVOID lpParam // thread parameter
);
byPriority
0 |
The maximum allowable priority of the calling thread's process. |
1-254 |
The new thread's priority; this must not exceed the maximum allowable priority of the calling thread's process. |
lpEntry
void ThreadFunc(LPVOID lpParam)
{
}
dwStackSize
lpParam
CreateRtThread creates a new thread which starts executing at the function indicated by lpEntry. If the current process references any RSLs then the RSL entry routine is called before the thread function is executed with a reason code of RSL_THREAD_ATTACH. If the thread returns from the thread function then it deletes itself by calling DeleteRtThread.
INtime thread priority 0-2 masks all RT interrupts including the INtime system tick.
INtime thread priority 3-60 masks all RT interrupts with IDT vectors 224-239.
INtime thread priority 61-255 makss no RT interrupts.
Multiple MSI uses AllocateRtInterrupts() to allocate vectors in the range 96-223. Interrupts on these vectors are masked by threads with priority 0-128.
BAD_RTHANDLE
E_OK 0x0000
E_MEM 0x0002
E_LIMIT 0x0004
byPriority contains a value other than 0 (zero) and greater (numerically smaller) than the maximum allowable priority for threads in the calling thread's process. E_SLOT 0x000C
E_PARAM 0x8004
dwStackSize contains a value of 0.
E_BAD_ADDR 0x800F
lpEntry is invalid. One of these conditions exist:
lpEntry is outside the calling thread's virtual address space.
| Versions | Defined in | Include | Link to |
|---|---|---|---|
| INtime 3.0 | intime/rt/include/rtbase.h | rt.h | rt.lib |