[Toc][Index]

DosExit


Bindings:  C, MASM 

This call is issued when a thread completes executing. The current thread 
or process ends. 
 DosExit    (ActionCode, ResultCode) 
 
 ActionCode (USHORT) - input 
    Terminates the process and all its threads. 
    Value     Definition 
    0         The current thread ends. 
    1         All threads in the process end. 
 ResultCode (USHORT) - input 
    Program's completion code.  It is passed to any thread that issues 
    DosCwait for this process. 
 
 Remarks 
 DosExit allows a thread to terminate itself or be terminated by another 
 thread in its process. If ActionCode=0 and the specified thread is the 
 last thread executing in the process, or if ActionCode=1, the process 
 terminates. 
 The system can start threads on behalf of an application. Thus, if the 
 intent of a DosExit call is to terminate the process, ActionCode=1 should 
 be specified to terminate all the threads belonging to the process. 
 Do not terminate thread 1 without terminating the process. Thread 1 is 
 the initial thread of execution, not a thread started by a 
 DosCreateThread request.  When thread 1 ends, any monitors or signal 
 processing routines set for this process also end. To avoid unpredictable 
 results, DosExit should be specified with ActionCode=1 to ensure the 
 process ends. 
 When a process is terminating, all but one thread is terminated and that 
 thread executes routines whose addresses have been specified with 
 DosExitList.  After resources have been cleaned up by the exit list 
 routines, this thread and all other resources owned by the process are 
 released. 
 
 Family API Considerations 
 Some options operate differently in the DOS mode than in the OS/2 mode. 
  Therefore, the following restrictions apply to DosExit when coding for 
 the DOS mode: 
 There is no thread support in DOS 3.3; therefore DosExit exits the 
 currently executing program. 
 If ActionCode = 0 this option is ignored.  It is equivalent to an 
 ActionCode = 1. 

Created using Inf-PHP v.2 (c) 2003 Yuri Prokushev
Created using Inf-HTML v.0.9b (c) 1995 Peter Childs