TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Eddy Thilleman
from: Herbert Rosenau
date: 1999-08-28 10:19:13
subject: Terminating threads clean

MR>> Those are for making sure something is finished without being
MR>> interrupted by signals or exceptions.

MR>> The functions DosEnterCritSec() and DosExitCritSec() are
MR>> intended for making sure the current thread completes before
MR>> all others in the same process (by setting it at a higher
MR>> priority).

 ET> I thought that was by preventing being interrupted, not by
 ET> setting it at a 
 ET> higher priority?

No. DosEnterCritSec does not more than blocking all other threads of the same
process. Other Threads of other processes can and will become CPU after
timslice of the running thread is over.

Most (but not all) OS/2 APIs calls DosExitCritSec() under cover. So you should 
not use any API (system, runtime, library) unless you know that this function
would never call a system API.

--- Sqed/32 1.14/development
104
* Origin: Schont die Umwelt: Vermeidet DOSen (2:2476/493)

SOURCE: echoes via The OS/2 BBS

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.