TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Daniel Lynes
from: Mike Burgett
date: 1996-09-20 15:32:24
subject: DosWaitThread

Hi Daniel,

Replying to a message of Daniel Lynes to Mike Burgett:

 MB>> DosWaitThread purports to either wait on any thread to die (if
 MB>> one hasn't already died) or to wait on a specific thread to die.
 MB>> One of the parameters it takes is a PTID

 DL> APIRET  rc ;
 DL> TID     tid ;

 DL> tid=_beginthread( ... ) ;
 DL> DosKillThread( tid ) ;
 DL> DosWaitThread( tid, PERIOD ) ;

 DL> .
 DL> .
 DL> .

 DL> rc=DosCreateThread( &tid, ... ) ;
 DL> And then the same ...


The above doesn't track with the docs on DosWaitThread, which claims it
takes a PTID, not a TID (a pointer to, instead of pass by ref.).  This
makes sense, since it also says it returns the TID of the thread that
exited in the location pointed to by the TID pointer.

 MB>> Is a tid the result returned by _beginthread() or the

 DL> Yes.

 MB>> tib->tib_ptib2->pib2_ultid ? Or can it only be obtained by using

 DL> The tid is the thread identification.  The tib is the thread
 DL> identification block.

The tib is the thread info block, but the thing I wrote above is the tid
stored in the tib. (aren't these ibm abbreviations fun? :)

 [ .... ]

 MB>> The reason I ask, is that DosWaitThread doesn't seem to be
 MB>> waiting for a thread to exit in the first two cases, and I don't
 MB>> really want to recode just to test the third....

 DL> You have to kill the thread first.  Then you can wait for it to
 DL> finish.

I don't want to kill it, I want to wait until it's finished processing, so
that it doesn't get killed when thread 1 exits.  It will die normally when
it's done, I just want to wait for that to happen... 

Thanks,
Mike

--- FleetStreet 1.17+
* Origin: Common Sense BBS - 510.713.7336 Newark, CA (1:215/705)
SEEN-BY: 50/99 270/101 620/243 625/100 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/888 800/1
@PATH: 215/705 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™.