TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Mike Burgett
from: Daniel Lynes
date: 1996-09-18 07:28:04
subject: DosWaitThread

Hello Mike!

16 Sep 96 23:14, Mike Burgett wrote to All:

 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

APIRET  rc ;
TID     tid ;

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

.
.
.

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

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

Yes.

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

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

 MB> DosCreateThread instead of _beginthread ?

They are similar functions.  DosCreateThread() is in the API.  _beginthread
is part of the Watcom library, and judging by the compiler you're using,
CSet/2 also.  However, in this case, I would suggest _beginthread() as it
saves a lot of hassle.  There seems to be more documentation available on
it, than on the DosCreateThread() function.

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

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

Daniel

--- GoldED/2 2.42.G0615+
* Origin: Enitharmon/2 Beta Home Site 604-527-0195 (1:153/8028)
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: 153/8028 831 800 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™.