TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Bill Bond
from: Phil Crown
date: 1996-05-20 22:10:02
subject: DosWaitThread()

-=> Quoting Bill Bond to all <=- 

 BB> I'm having trouble with one of my programs and I'm beginning to
 BB> wonder how reliable the DosWaitThread() function is.  What happens is
 BB> that every once and a while a thread will end but DosWaitThread()
 BB> doesn't return (both parameters are 0).  To test this I ran the
 BB> program from a cmd file in a loop so that it keeps running over and
 BB> over.  It'll run fine maybe 50 or 100 times (or more) but eventually a
 BB> call to DosWaitThread() doesn't return when it should, or so it seems.
 BB> I know the program is not locked up because I can terminate it with a
 BB> keypress.  One of the threads monitors the keyboard and returns when 
 BB> a predefined key is pressed.  In this case DosWaitThread() returns as
 BB> expected. 
 BB> Has anyone seen anything like this before?  I believe this started
 BB> happening around the time I upgraded to Warp, or possibly one of the
 BB> Warp fixpacks, but I'm not positive.  The program had been running ok
 BB> for some time before it started misbehaving. 
 BB> thanks,
 BB> Bill

I've noticed something like this.  My program has 6 threads running.
When I exit, I call DosWaitThread() to wait for each thread to
terminate.

Sometimes (1 in 50 or 100 as you mentioned) my program will hang and I
have to kill the program from the Tasklist after pressing Ctrl-Esc
twice.  It is always the same thread that hangs, and I'm not sure if its
hanging in DosWaitThread().

Are you using an exit list (DosExitList())?  I am not, but perhaps I
should be.

Phil - Fido:  1:124/8014.0 | Internet:  phil.crown{at}bluecafe.com


--- Blue Wave/OS2 v2.30
* Origin: * MacSavvy OS/2 BBS * Dallas, Texas * 214-250-4479 * (1:124/1208)
SEEN-BY: 50/99 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1
@PATH: 124/1208 1 396/1 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

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™.