Waiting On and Terminating Threads

Under previous versions of OS/2, when an application wished to determine whether an asynchronous thread had completed execution, it was required to do so through the use of semaphores, which were periodically checked by the waiting thread. OS/2 Version 2.0 provides a DosWaitThread() function which allows an application to determine whether a given thread is currently executing, and to either wait for the thread to complete, or time-out immediately.

A thread may also be terminated from within an application using the DosKillThread() function. Under previous versions of OS/2, a thread could not be forcibly terminated by another thread, unless its parent process was also terminated.


[Back: Controlling Threads]
[Next: Semaphores]