TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: John Slagle
from: Mario Semo
date: 1995-11-02 08:21:36
subject: _beginthread killthread

Hello John,

On Oct 24 20:04 95, John Slagle of 1:104/720 wrote:

 JS> As an alternative to _endthread, the return from the 
 JS> routine called with _beginthread does an implied endthread.

FYI:

using _endthread is the dirty way of termination. eq. if you have (in C++)
instances of objects, they are NOT destroyed. With return they are.

sample:

class C
{
 public:
   C() {...}
   ~C() { ...}
};

/* ... */ threadfund1(...)  // call via _beginthread
{
 C c;
 return;
} // C is destroyed


/* ... */ threadfunc2(...) // call via _beginthread
{
 C c;
 _endthread();
 return;
} // c is NOT destroyed

 WARPED!, Mario

--- Msgedsq/2 2.2e
* Origin: LC/32 Development Team-Vienna-Austria (2:310/14.11)
SEEN-BY: 270/101 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 517 628 713/888 800/1 7877/2809
@PATH: 310/14 1 24/999 2/777 396/1 270/101 712/515 711/808 809 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™.