join simply waits (blocks) until a thread exits or is canceled. Normally you do not have to call join in your application at all; if you delete a Thread derived object, if it's derived ~destructor invokes terminate(), then during the delete, the target thread will be both canceled and joined for you automatically. Usually it is best to put terminate() first in the derived destructor, and any other cleanup code after that. The cleanup code will then execute in the context of the thread that is initiating the delete, and will happen after the target thread has stopped executing so there is no risk of a resource still in use by the target thread.

Dan Weber wrote:


On Tue, 18 Jan 2005, Laurielle LEA wrote:

Hi everybody,

I use Thread class of OST namespace.
When I use join(), my application is blocking
sometimes, so I remove this function and it seems to
work better.
I would like to know if it's good or not to have
removed it on my code.


The entire point of join is to block util the thread dies. Thats standard practice with all threads.

Dan


_______________________________________________ Ccrtp-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/ccrtp-devel
begin:vcard
fn:David Sugar
n:Sugar;David
org:GNU Project
adr:;;23 Olin Drive;Cape May Court House;NJ;08210;USA
email;internet:[EMAIL PROTECTED]
tel;home:1 609 465 5336
tel;cell:1 908 917 6084
x-mozilla-html:FALSE
url:http://www.ostel.com
version:2.1
end:vcard

_______________________________________________
Ccrtp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/ccrtp-devel

Reply via email to