Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
DosEnterCritSec (1.2)
◄Function Group► ◄Overview► ◄Changes► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_DOSPROCESS
USHORT DosEnterCritSec(VOID)
The DosEnterCritSec function suspends execution of all threads in the
current process, except for the calling thread. Suspended threads cannot
execute until the current thread calls the DosExitCritSec function.
This function has no parameters.
Return Value
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be the following:
ERROR_CRITSEC_OVERFLOW
Comments
The signal handler (if installed) is not suspended when the DosEnterCritSec
function is called. If a signal occurs, the processing done by the signal
handler must not interfere with the processing done by the thread calling
the DosEnterCritSec function.
MS OS/2 maintains the number of outstanding DosEnterCritSec requests. This
count is incremented by DosEnterCritSec requests and decremented by
DosExitCritSec requests. If the count is greater than zero, a
DosExitCritSec request will not restore normal thread execution. If the
count exceeds 65535, the error ERROR_CRITSEC_OVERFLOW will be returned.
See Also
DosCreateThread, DosExitCritSec, DosHoldSignal, DosSetSigHandler
♦