DosExit: Difference between revisions
Appearance
No edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
'''DosExit''' ends the current or all threads in a process and gives a result code to be passed to another thread when calling DosWaitChild. If the thread ended was the last thread or all threads are ended, then the whole process is ended. | '''DosExit''' ends the current or all threads in a process and gives a result code to be passed to another thread when calling [[DosWaitChild]]. If the thread ended was the last thread or all threads are ended, then the whole process is ended. | ||
==Syntax== | |||
DosExit( ''ulAction'', ''ulResult'' ) | DosExit( ''ulAction'', ''ulResult'' ) | ||
==Parameters== | |||
;ULONG ''ulAction'' (input): Ends one or all threads of the process. Values are: | ;ULONG ''ulAction'' (input): Ends one or all threads of the process. Values are: | ||
::0 EXIT_THREAD - The current thread is ended. If the current thread is the last thread, the process is ended. | |||
::1 EXIT_PROCESS - The process and all threads in it is ended. | |||
;ULONG ''ulResult'' (input): Program completion code passed to any thread that issues DosWaitChild for the current process. | |||
; ULONG ''ulResult'' (input) | |||
: Program completion code passed to any thread that issues DosWaitChild for the current process. | |||
==Include Info== | |||
#define INCL_DOSPROCESS | #define INCL_DOSPROCESS | ||
#include <os2.h> | #include <os2.h> | ||
==Gotchas== | |||
Do not end thread 1 ( | Do not end thread 1 (i.e. the main thread) without ending the process. | ||
==Sample Code== | |||
#define INCL_DOSPROCESS | #define INCL_DOSPROCESS | ||
#include <os2.h> | #include <os2.h> |
Latest revision as of 18:24, 29 August 2021
DosExit ends the current or all threads in a process and gives a result code to be passed to another thread when calling DosWaitChild. If the thread ended was the last thread or all threads are ended, then the whole process is ended.
Syntax
DosExit( ulAction, ulResult )
Parameters
- ULONG ulAction (input)
- Ends one or all threads of the process. Values are:
- 0 EXIT_THREAD - The current thread is ended. If the current thread is the last thread, the process is ended.
- 1 EXIT_PROCESS - The process and all threads in it is ended.
- ULONG ulResult (input)
- Program completion code passed to any thread that issues DosWaitChild for the current process.
Include Info
#define INCL_DOSPROCESS #include <os2.h>
Gotchas
Do not end thread 1 (i.e. the main thread) without ending the process.
Sample Code
#define INCL_DOSPROCESS #include <os2.h> DosExit(1,4711); /* End all threads and the process, */ /* and pass the value 4711 to any */ /* thread doing DosWaitChild on this process */