The DosCreateThread() function has been enhanced in OS/2 Version 2.0 to facilitate the creation of secondary threads. Under previous versions of OS/2, an application was required to explicitly allocate a memory segment for the stack to be used by a secondary thread. Under OS/2 Version 2.0 however, stack allocation is performed as a built-in part of the DosCreateThread() function, and deallocation is performed automatically by the operating system upon termination of a thread.
Applications that use the DosCreateThread() function should be modified to use the new form of the function call, as shown in Figure "DosCreateThread() Function".
Note that the DosCreateThread() function under OS/2 Version 2.0 also allows parameters to be passed to the thread as part of the DosCreateThread() function. The third parameter to the function is a 32-bit pointer, which may be used to pass the address of an application-defined data structure containing the required parameter data.
The DosCreateThread() function and its implementation under OS/2 Version 2.0 are described in greater detail in IBM OS/2 Version 2.0 Control Program Reference.
OS/2 Version 2.0 also allows an application to forcibly terminate a thread using the DosKillThread() function. This function allows an application's primary thread to terminate any secondary threads prior to its own shutdown, in a more elegant manner than was possible under previous versions of OS/2.