Home |
RTKernel-32 Programming Manual Multitasking, Real-Time, and RTKernel-32 Alternate APIs for RTKernel-32 RTKernel-C 4.5 for DOS Compatible API Win32 and RTKernel-32 Error Handling Mixing RTKernel-32 and Win32 APIs Function CreateThread Function InitializeCriticalSection Function InitializeCriticalSectionAndSpinCount Function TryEnterCriticalSection Function DeleteCriticalSection Function WaitForMultipleObjects Function QueryPerformanceCounter Function QueryPerformanceFrequency Function GetSystemTimeAdjustment Function SetThreadAffinityMask Function SetThreadGroupAffinity |
Function CreateThreadCreateThread allocates a thread object and associates a Win32 handle with it. The thread is created by calling RTKCreateThread. The name of the task is set to "Win32 Thread". Floating point context maintenance for the new thread is controlled by RTKConfig.Flags. The priority is set to RTKConfig.MainPriority. If this is 0, RTKConfig.DefaultPriority is used. If this value is also 0, the new thread is created with the priority of the creating thread. *ThreadId receives the RTKernel-32 task handle. In addition, an event semaphore is associated with the thread object to allow waiting for task termination. If parameter dwStackSize is 0, RTKConfig.DefaultTaskStackSize is used. The thread object created by this function exists until the last handle to the thread is closed using CloseHandle and the thread terminates, in either order. Usually, you should not call CreateThread directly. Instead, run-time system routines provided for thread creation (like _beginthread) or RTKRTLCreateThread should be used. All high-level thread creation functions of the C/C++ run-time systems call CreateThread. Please note that some of these will automatically close the returned Win32 handle, while others do not. If you need a handle with a longer life span, use DuplicateHandle to get a second handle. Please also note that some run-time system functions do not return the Win32 handle, but the thread ID.
|